KrisLibrary  1.0.0
infnan.h
Go to the documentation of this file.
1 #ifndef MATH_INFNAN_H
2 #define MATH_INFNAN_H
3 
4 #if defined (__APPLE__) || defined (MACOSX)
5 #include "/usr/include/math.h"
6 #else
7 #include <math.h>
8 #endif
9 
10 #ifndef INFINITY
11  #include <limits>
12 #endif //INFINITY
13 
25 namespace Math {
26 
29 
30 
31 #ifdef INFINITY
32  const static double dInf = INFINITY;
33  const static float fInf = INFINITY;
34 #else
35  const static double dInf = std::numeric_limits<double>::infinity();
36  const static float fInf = std::numeric_limits<float>::infinity();
37 #endif // INFINITY
38 
39 
41 int IsNaN(double x);
42 int IsNaN(float x);
44 int IsFinite(double x);
45 int IsFinite(float x);
47 int IsInf(double x);
48 int IsInf(float x);
49 
51 } //namespace Math
52 
53 #endif
Common math typedefs, constants, functions.
int IsInf(double x)
Returns +1 if x is +inf, -1 if x is -inf, and 0 otherwise.
Definition: infnan.cpp:92
int IsNaN(double x)
Returns nonzero if x is not-a-number (NaN)
Definition: infnan.cpp:61
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12
int IsFinite(double x)
Returns nonzero unless x is infinite or a NaN.
Definition: infnan.cpp:75