floating point verification using is?

bearophile bearophileHUGS at lycos.com
Fri Dec 18 11:47:13 PST 2009


Steven Schveighoffer:
> float x;
> 
> assert(isIdentical(x, float.init)); // fails
> 
> This is what I'm trying to test.  It has to do with the fact that  
> float.init is a literal, and I think it's automatically converted to  
> real.init.

Try this:
http://www.digitalmars.com/d/2.0/phobos/std_math.html#isNaN

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list