lemon/math.h
changeset 802 994c7df296c9
parent 470 81627fa1b007
child 877 141f9c0db4a3
     1.1 --- a/lemon/math.h	Fri Nov 13 12:33:33 2009 +0100
     1.2 +++ b/lemon/math.h	Thu Dec 10 17:05:35 2009 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2008
     1.8 + * Copyright (C) 2003-2009
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -55,6 +55,15 @@
    1.13    /// 1/sqrt(2)
    1.14    const long double SQRT1_2 = 0.7071067811865475244008443621048490L;
    1.15  
    1.16 +  ///Check whether the parameter is NaN or not
    1.17 +  
    1.18 +  ///This function checks whether the parameter is NaN or not.
    1.19 +  ///Is should be equivalent with std::isnan(), but it is not
    1.20 +  ///provided by all compilers.
    1.21 +  inline bool isNaN(double v)
    1.22 +    {
    1.23 +      return v!=v;
    1.24 +    }
    1.25  
    1.26    /// @}
    1.27