Another take on decimal data types

kdevel kdevel at vogtner.de
Sat Jan 13 16:42:21 UTC 2018


On Saturday, 13 January 2018 at 14:43:53 UTC, rumbu wrote:
> On Saturday, 13 January 2018 at 13:56:20 UTC, kdevel wrote:
>>
>> Now my code does no longer compiles against the decimal 
>> package. This is my directory structure:
>
> I received a suggestion to reorganize the file structure 
> because of some bug in dub 
> (https://issues.dlang.org/show_bug.cgi?id=11847). The dub.json 
> remained out of sync.
>
> I changed it, but I am not 100% sure that it's working. I am 
> not experienced with dub, If someone wants to maintain 
> dub.json, I will be more than happy to accept any pull request.

I only invoked dub in order to generate libdecimal.a

> Personally I hate dub because it's polluting my %APPDATA% 
> folder and each time I connect my laptop to the company domain 
> network, I must wait to sync zillions of files.

I have now the following directory structure:

    dlang-decimal/
       decimal -> decimal.git/src/decimal/
       decimal.git/                             [git cloned <url> 
decimal.git]
          libdecimal.a
          src/
             decimal/
                floats.d
                floats.di
                integrals.d
                integrals.di
                package.d
                package.di
                ranges.d
                ranges.di
                sinks.d
                sinks.di
       nosine.d

I have generated the .di files with dmd -H *.d within the 
src/decimal directory. Now dmd in unwilling to compile:

$ dmd nosine.d decimal.git/libdecimal.a
decimal/integrals.di(537): Error: xadd cannot be interpreted at 
compile time, because it has no available source code
decimal/integrals.di(567):        called from here: xadd(result, 
z)
decimal/integrals.di(121):        called from here: fma(this, 
10u, cast(uint)(cast(int)c - 48), ovf)
decimal/integrals.di(978):        called from here: unsigned(0LU, 
0LU).this("100000000000000000000")
[the four lines repeat untill 77 lines are printed]

How come?


More information about the Digitalmars-d-announce mailing list