lemon/math.h
changeset 783 ef88c0a30f85
parent 470 81627fa1b007
child 877 141f9c0db4a3
     1.1 --- a/lemon/math.h	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/lemon/math.h	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -55,6 +55,15 @@
     1.4    /// 1/sqrt(2)
     1.5    const long double SQRT1_2 = 0.7071067811865475244008443621048490L;
     1.6  
     1.7 +  ///Check whether the parameter is NaN or not
     1.8 +  
     1.9 +  ///This function checks whether the parameter is NaN or not.
    1.10 +  ///Is should be equivalent with std::isnan(), but it is not
    1.11 +  ///provided by all compilers.
    1.12 +  inline bool isNaN(double v)
    1.13 +    {
    1.14 +      return v!=v;
    1.15 +    }
    1.16  
    1.17    /// @}
    1.18