comparison liboctave/numeric/lo-mappers.cc @ 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 40de9f8f23a6
comparison
equal deleted inserted replaced
21231:5f318c8ec634 21232:b8cf410b5c88
137 return (ax != lax) ? (x / ax) * lax : x; 137 return (ax != lax) ? (x / ax) * lax : x;
138 } 138 }
139 139
140 // double -> bool mappers. 140 // double -> bool mappers.
141 141
142 #if ! defined (HAVE_CMATH_ISNAN)
143 bool 142 bool
144 xisnan (double x) 143 xisnan (double x)
145 { 144 {
145 #if defined (HAVE_CMATH_ISNAN)
146 return std::isnan (x);
147 #else
146 return lo_ieee_isnan (x); 148 return lo_ieee_isnan (x);
147 } 149 #endif
148 #endif 150 }
149 151
150 #if ! defined (HAVE_CMATH_ISFINITE)
151 bool 152 bool
152 xfinite (double x) 153 xfinite (double x)
153 { 154 {
155 #if defined (HAVE_CMATH_ISFINITE)
156 return std::isfinite (x);
157 #else
154 return lo_ieee_finite (x); 158 return lo_ieee_finite (x);
155 } 159 #endif
156 #endif 160 }
157 161
158 #if ! defined (HAVE_CMATH_ISINF)
159 bool 162 bool
160 xisinf (double x) 163 xisinf (double x)
161 { 164 {
165 #if defined (HAVE_CMATH_ISINF)
166 return std::isinf (x);
167 #else
162 return lo_ieee_isinf (x); 168 return lo_ieee_isinf (x);
163 } 169 #endif
164 #endif 170 }
165 171
166 bool 172 bool
167 octave_is_NA (double x) 173 octave_is_NA (double x)
168 { 174 {
169 return lo_ieee_is_NA (x); 175 return lo_ieee_is_NA (x);
356 return (ax != lax) ? (x / ax) * lax : x; 362 return (ax != lax) ? (x / ax) * lax : x;
357 } 363 }
358 364
359 // float -> bool mappers. 365 // float -> bool mappers.
360 366
361 #if ! defined (HAVE_CMATH_ISNANF)
362 bool 367 bool
363 xisnan (float x) 368 xisnan (float x)
364 { 369 {
370 #if defined (HAVE_CMATH_ISNANF)
371 return std::isnan (x);
372 #else
365 return lo_ieee_isnan (x); 373 return lo_ieee_isnan (x);
366 } 374 #endif
367 #endif 375 }
368 376
369 #if ! defined (HAVE_CMATH_ISFINITEF)
370 bool 377 bool
371 xfinite (float x) 378 xfinite (float x)
372 { 379 {
380 #if defined (HAVE_CMATH_ISFINITEF)
381 return std::isfinite (x);
382 #else
373 return lo_ieee_finite (x); 383 return lo_ieee_finite (x);
374 } 384 #endif
375 #endif 385 }
376 386
377 #if ! defined (HAVE_CMATH_ISINFF)
378 bool 387 bool
379 xisinf (float x) 388 xisinf (float x)
380 { 389 {
390 #if defined (HAVE_CMATH_ISINFF)
391 return std::isinf (x);
392 #else
381 return lo_ieee_isinf (x); 393 return lo_ieee_isinf (x);
382 } 394 #endif
383 #endif 395 }
384 396
385 bool 397 bool
386 octave_is_NA (float x) 398 octave_is_NA (float x)
387 { 399 {
388 return lo_ieee_is_NA (x); 400 return lo_ieee_is_NA (x);