On Wednesday, 30 June 2021 at 03:32:27 UTC, Vladimir Panteleev wrote:
On Wednesday, 30 June 2021 at 03:15:46 UTC, someone wrote:
Is the following code block valid ?

Comparison with `nan` always results in `false`:

See section 10.11.5:

https://dlang.org/spec/expression.html#equality_expressions

You can use the `is` operator to perform bitwise comparison, or use `std.math.isNaN`.

Side note: That doesn't apply to `if (myFloat)` or `assert(myFloat);`, unfortunately: https://issues.dlang.org/show_bug.cgi?id=13489

Reply via email to