Another take on decimal data types

rumbu rumbu at rumbu.ro
Sun Jan 14 07:20:26 UTC 2018


On Saturday, 13 January 2018 at 22:51:18 UTC, kdevel wrote:
> On Saturday, 13 January 2018 at 22:05:02 UTC, rumbu wrote:
>> Now it prints:
>>
>>      1.00    +0.841470984807896506690000 
>> +0.8414709848078965066525023216302990   +2.653e-18
>
> My values differ slightly
>      1.00     0.841470984807896506664591     
> 0.841470984807896506652502    3.653e-18
>
> But I would check this later.

Can you please tell me on your system what are the values for 
real.sizeof and real.mant_dig?


> Please note the large deltas in case of negative operands. I 
> suspect the conversion to real is wrong for these numbers:

> -0.996164608835840688668900        1.992
>      4.90    -0.982452612624332512691275    
> -0.982452612624332448489147        1.965
>      5.00    -0.958924274663138469525139    
> -0.958924274663138468893154        1.918
>      5.10    -0.925814682327732297803524

Forgot to propagate the sign in case of decimal to binary 
conversion. Corrected.

>
> There's also code which one would expect to compile:
>

It compiles now.



More information about the Digitalmars-d-announce mailing list