lemon/lp_base.h
changeset 2633 4f47c0f6be04
parent 2609 c36f00f19f2b
equal deleted inserted replaced
62:8c73ed3db96f 63:eda81dd8e578
    41   /// It does the same as the isfinite() function defined by C99.
    41   /// It does the same as the isfinite() function defined by C99.
    42   template <typename T>
    42   template <typename T>
    43   bool isFinite(T value)
    43   bool isFinite(T value)
    44   {
    44   {
    45     typedef std::numeric_limits<T> Lim;
    45     typedef std::numeric_limits<T> Lim;
    46     if (Lim::has_infinity && (value == Lim::infinity() || value ==
    46     if ((Lim::has_infinity && (value == Lim::infinity() || value ==
    47           -Lim::infinity()) ||
    47 			       -Lim::infinity())) ||
    48         (Lim::has_quiet_NaN || Lim::has_signaling_NaN) && value != value)
    48         ((Lim::has_quiet_NaN || Lim::has_signaling_NaN) && value != value))
    49     {
    49     {
    50       return false;
    50       return false;
    51     }
    51     }
    52     return true;
    52     return true;
    53   }
    53   }