On Monday, 30 October 2017 at 15:04:32 UTC, Steven Schveighoffer wrote:
https://issues.dlang.org/show_bug.cgi?id=13489
...
I'm in the camp that nan should be evaluated as false. I don't think I like the idea that !nan is also false, because this makes !!nan true!


The problem of converting NaN to binary is that NaN introduces a ternary logic. There is no way to convert the ternary value to binary without loss. If we want to be consistent we have to convert it to Nullable!bool, but not to bool. So, to introduce Elvis operator for floats in language and to stay consistent it needs also Nullable/Not-Nullable as part of language type system, IMHO.

Reply via email to