digitalmars.D.bugs - [Issue 13743] New: floating point inconsistent division by zero
- via Digitalmars-d-bugs (28/28) Nov 17 2014 https://issues.dlang.org/show_bug.cgi?id=13743
https://issues.dlang.org/show_bug.cgi?id=13743 Issue ID: 13743 Summary: floating point inconsistent division by zero Product: D Version: D1 & D2 Hardware: x86_64 OS: Linux Status: NEW Severity: minor Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: public dicebot.lv ``` void main() { real x = 1; real y = x / 0; assert(y is real.infinity); } ``` This passes when compiled without optimizations and fails when compiled with -O. When optimizations are enabled y is evaluated as NaN (probaby because of const-folding?) I don't know if this is bug or feature and if it should be fixed / changed at all but creating bugzilla issue just so that it won't be as much of surprise to others :) --
Nov 17 2014