lemon/math.h
changeset 493 81627fa1b007
parent 463 88ed40ad0d4f
child 558 06787db0ef5f
     1.1 --- a/lemon/math.h	Mon Jan 12 13:37:37 2009 +0000
     1.2 +++ b/lemon/math.h	Wed Jan 14 15:55:29 2009 +0000
     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