26 #if ! defined (octave_lo_ieee_h)
27 #define octave_lo_ieee_h 1
31 #include "octave-config.h"
33 #if defined (__cplusplus)
38 #define octave_Inf (lo_ieee_inf_value ())
41 #define octave_NA (lo_ieee_na_value ())
44 #define octave_NaN (lo_ieee_nan_value ())
47 #define octave_Float_Inf (lo_ieee_float_inf_value ())
50 #define octave_Float_NA (lo_ieee_float_na_value ())
53 #define octave_Float_NaN (lo_ieee_float_nan_value ())
70 #define LO_IEEE_NA_HW_OLD 0x7ff00000
71 #define LO_IEEE_NA_LW_OLD 1954
72 #if defined (HAVE_MIPS_NAN)
73 #define LO_IEEE_NA_HW 0x7FF040F4
75 #define LO_IEEE_NA_HW 0x7FF840F4
77 #define LO_IEEE_NA_LW 0x40000000
78 #define LO_IEEE_NA_FLOAT 0x7FC207A2
108 #if defined (__cplusplus)
112 #define lo_ieee_isnan(x) \
113 (sizeof (x) == sizeof (float) \
114 ? __lo_ieee_float_isnan (x) : __lo_ieee_isnan (x))
116 #define lo_ieee_finite(x) \
117 (sizeof (x) == sizeof (float) \
118 ? __lo_ieee_float_finite (x) : __lo_ieee_finite (x))
120 #define lo_ieee_isinf(x) \
121 (sizeof (x) == sizeof (float) \
122 ? __lo_ieee_float_isinf (x) : __lo_ieee_isinf (x))
124 #define lo_ieee_is_NA(x) \
125 (sizeof (x) == sizeof (float) \
126 ? __lo_ieee_float_is_NA (x) : __lo_ieee_is_NA (x))
128 #define lo_ieee_is_NaN_or_NA(x) \
129 (sizeof (x) == sizeof (float) \
130 ? __lo_ieee_float_is_NaN_or_NA (x) : __lo_ieee_is_NaN_or_NA (x))
132 #define lo_ieee_signbit(x) \
133 (sizeof (x) == sizeof (float) \
134 ? __lo_ieee_float_signbit (x) : __lo_ieee_signbit (x))
136 #if defined (__cplusplus)
140 template <
typename T>
141 struct numeric_limits
143 static T NA (
void) {
return static_cast<T
> (0); }
144 static T
NaN (
void) {
return static_cast<T
> (0); }
145 static T
Inf (
void) {
return static_cast<T
> (0); }
149 struct numeric_limits<double>
151 static double NA (
void) {
return octave_NA; }
157 struct numeric_limits<float>
OCTAVE_API float lo_ieee_float_nan_value(void)
int __lo_ieee_float_finite(float x)
int __lo_ieee_finite(double x)
int __lo_ieee_signbit(double x)
OCTAVE_API double lo_ieee_nan_value(void)
OCTAVE_API int __lo_ieee_is_old_NA(double)
OCTAVE_API float lo_ieee_float_na_value(void)
OCTAVE_API double lo_ieee_inf_value(void)
int __lo_ieee_isinf(double x)
OCTAVE_API int __lo_ieee_is_NA(double)
OCTAVE_API int __lo_ieee_float_is_NA(float)
OCTAVE_API double lo_ieee_na_value(void)
int __lo_ieee_float_isinf(float x)
int __lo_ieee_float_signbit(float x)
OCTAVE_API void octave_ieee_init(void)
int __lo_ieee_float_isnan(float x)
OCTAVE_API float lo_ieee_float_inf_value(void)
int __lo_ieee_isnan(double x)
OCTAVE_API double __lo_ieee_replace_old_NA(double)
F77_RET_T const F77_DBLE * x