Project Elvis

Steven Schveighoffer schveiguy at yahoo.com
Mon Oct 30 15:04:32 UTC 2017


On 10/29/17 3:10 PM, Nemanja Boric wrote:
> We've already reported this as a bug (I actually got quite burned on it, 
> trusting assert(float_value) to prevent NaN's escaping the function), 
> but there were different opinions on this, so it never got anywhere: 
> https://issues.dlang.org/show_bug.cgi?id=13489

Wow, interesting dialog there.

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!

TBH, I don't think I ever considered doing if(floatingpointvalue) to be 
a good idea in C or D. I generally stay away from float, and especially 
comparing to 0 directly.

-Steve


More information about the Digitalmars-d mailing list