lemon/math.h
changeset 784 1a7fe3bef514
parent 470 81627fa1b007
child 877 141f9c0db4a3
     1.1 --- a/lemon/math.h	Fri Oct 16 10:21:37 2009 +0200
     1.2 +++ b/lemon/math.h	Thu Nov 05 15:50:01 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