May 05, 2005 incorrect casting of negative floating point constants (dmd 0.122) | ||||
---|---|---|---|---|
| ||||
<code> void main(){ const double d = -1.0; int i = cast(int)d; assert(-1 == i); // <- assertion failure } </code> Negative "const double" or "const float" is always converted to zero. |
Copyright © 1999-2021 by the D Language Foundation