Floating point init/nan

Adam D. Ruppe destructionator at gmail.com
Fri Feb 14 21:28:05 PST 2014


On Saturday, 15 February 2014 at 05:18:51 UTC, Adam S wrote:
> assert(float.init == float.nan);

nan never equals nan, this is in the floating point spec used by 
D, C and others.

Use this instead:
http://dlang.org/phobos/std_math.html#isNaN


More information about the Digitalmars-d-learn mailing list