The following assert fails when compiled with dmd's command line options -O -m32: import std.conv; void main() { char[] input = "1.5e3".dup; assert(1500 == parse!double(input)); // <-- FAILS } It fails for float and real as well. Please note that this combination works: -O -m64 Ali
Under platform, please put x86 if it's a 32-bit bug, even if you ran the code on a 64-bit machine. I can also reproduce this on Windows. Note that the answer is correct if -release is also enabled.
This one was introduced in DMD 2.048 -> it's a regression. Also, since optimization settings affect the result, I think it's safe to call this a wrong-code bug.
This was fixed a couple of days ago. https://github.com/D-Programming-Language/dmd/commit/597d233d1111a0d81382db265df07ba15bff1b0c
*** Issue 8120 has been marked as a duplicate of this issue. ***