On Thursday, 19 May 2016 at 18:22:48 UTC, Timon Gehr wrote:
dmd -run kahanDemo.d
1000000000000000.000000
1000000100000000.000000
1000000000000000.000000
dmd -m32 -O -run kahanDemo.d
1000000000000000.000000
1000000000000000.000000
1000000000000000.000000
Better?
Ignore if you think it's not relevant.
I am a bit lost in this thread. I thought this was about floating
point CTFE, but I think what you are seeing here (in the 2nd
case) is the DMD optimizer allowing reassociation of fp
expressions? LDC does not allow that (per default) and produces
the 1000000100000000.000000 result also with optimization on.
-Johan