Another take on decimal data types

kdevel kdevel at vogtner.de
Thu Jan 11 20:44:13 UTC 2018


On Thursday, 11 January 2018 at 20:35:03 UTC, kdevel wrote:
>    printf ("%.2f\n", d);

This must read

    writefln ("%.2f", d);

Would have expected a compile time/run time error.

> This prints:
>
>    0.735
>    0.00      <--- expected: 0.74

Good. writefln prints the expected value.

>    0.735
>    0.73
>              <--- loop output missing

This is still missing. If I change the while-loop threshold to 
1e-9 the values are printed.


More information about the Digitalmars-d-announce mailing list