[Issue 18054] Wrong cast of float constant to bool

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 11 08:27:40 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=18054

Mike Parker <aldacron at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldacron at gmail.com

--- Comment #1 from Mike Parker <aldacron at gmail.com> ---
This also happens with double & real, and literals.

auto d = 0.5;
assert(cast(bool)d);
assert(cast(bool)0.5);

--


More information about the Digitalmars-d-bugs mailing list