[Issue 9937] CTFE floats don't overflow correctly
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Sep 29 03:18:25 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=9937
Martin Nowak <code at dawg.eu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |code at dawg.eu
--- Comment #23 from Martin Nowak <code at dawg.eu> ---
The real problem is that dmd (as only compiler) ignores `cast(float)myReal`
when the float is converted to a higher precision after that.
This optimization is semantically incorrect b/c rounding down can have side
effects (setting exception flags). It's also unexpected b/c C (and gdc/ldc)
correctly perform the rounding.
Also see
https://github.com/dlang/druntime/pull/1621#issuecomment-250426515
--
More information about the Digitalmars-d-bugs
mailing list