Casting double to ulong weirdness

rumbu via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 24 11:06:07 PDT 2015


BTW, 1.2 and 12.0 are directly representable as double

In C++:

printf("%.20f\r\n", 1.2);
printf("%.20f\r\n", 12.0);

will output:

1.20000000000000000000
12.00000000000000000000

Either upcasting to real is the wrong decision here, either the 
writeln string conversion is wrong.




More information about the Digitalmars-d mailing list