equal
deleted
inserted
replaced
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 } |