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: [email protected]
Reporter: [email protected]
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;
--
