December 10, 2017 [Issue 18054] New: Wrong cast of float constant to bool | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18054 Issue ID: 18054 Summary: Wrong cast of float constant to bool Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: rumbu@rumbu.ro Any float constant between -1 and 1 cast to bool will return false: float f = float.min_normal; bool fcast1 = cast(bool)f; bool fcast2 = cast(bool)(float.min_normal); assert(fcast1); //ok assert(fcast2); //error; -- |
Copyright © 1999-2021 by the D Language Foundation