comparison liboctave/numeric/lo-mappers.h @ 21232:b8cf410b5c88

eliminate feature tests from lo-mappers.h * lo-mappers.h, lo-mappers.cc (xisinf, xisnan, xfinite): Move feature tests inside functions in lo-mappers.cc.
author John W. Eaton <jwe@octave.org>
date Tue, 09 Feb 2016 04:55:29 -0500
parents 5f318c8ec634
children 1473547f50f5
comparison
equal deleted inserted replaced
21231:5f318c8ec634 21232:b8cf410b5c88
51 51
52 // These are used by the BOOL_OP macros in mx-op-defs.h. 52 // These are used by the BOOL_OP macros in mx-op-defs.h.
53 inline bool xisnan (bool) { return false; } 53 inline bool xisnan (bool) { return false; }
54 inline bool xisnan (char) { return false; } 54 inline bool xisnan (char) { return false; }
55 55
56 #if defined (HAVE_CMATH_ISNAN)
57 inline bool xisnan (double x)
58 { return std::isnan (x); }
59 #else
60 extern OCTAVE_API bool xisnan (double x); 56 extern OCTAVE_API bool xisnan (double x);
61 #endif
62 #if defined (HAVE_CMATH_ISFINITE)
63 inline bool xfinite (double x)
64 { return std::isfinite (x); }
65 #else
66 extern OCTAVE_API bool xfinite (double x); 57 extern OCTAVE_API bool xfinite (double x);
67 #endif
68 #if defined (HAVE_CMATH_ISINF)
69 inline bool xisinf (double x)
70 { return std::isinf (x); }
71 #else
72 extern OCTAVE_API bool xisinf (double x); 58 extern OCTAVE_API bool xisinf (double x);
73 #endif
74 59
75 extern OCTAVE_API bool octave_is_NA (double x); 60 extern OCTAVE_API bool octave_is_NA (double x);
76 61
77 // Generic xmin, xmax definitions 62 // Generic xmin, xmax definitions
78 template <typename T> 63 template <typename T>
129 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x); 114 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x);
130 extern OCTAVE_API float xlog2 (float x, int& exp); 115 extern OCTAVE_API float xlog2 (float x, int& exp);
131 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x, int& exp); 116 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x, int& exp);
132 extern OCTAVE_API float xexp2 (float x); 117 extern OCTAVE_API float xexp2 (float x);
133 118
134 #if defined (HAVE_CMATH_ISNANF)
135 inline bool xisnan (float x)
136 { return std::isnan (x); }
137 #else
138 extern OCTAVE_API bool xisnan (float x); 119 extern OCTAVE_API bool xisnan (float x);
139 #endif
140 #if defined (HAVE_CMATH_ISFINITEF)
141 inline bool xfinite (float x)
142 { return std::isfinite (x); }
143 #else
144 extern OCTAVE_API bool xfinite (float x); 120 extern OCTAVE_API bool xfinite (float x);
145 #endif
146 #if defined (HAVE_CMATH_ISINFF)
147 inline bool xisinf (float x)
148 { return std::isinf (x); }
149 #else
150 extern OCTAVE_API bool xisinf (float x); 121 extern OCTAVE_API bool xisinf (float x);
151 #endif
152 122
153 extern OCTAVE_API bool octave_is_NA (float x); 123 extern OCTAVE_API bool octave_is_NA (float x);
154 124
155 inline float 125 inline float
156 xmin (float x, float y) 126 xmin (float x, float y)