Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_liboctave_ieee_h)
00024 #define octave_liboctave_ieee_h 1
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030
00031 extern OCTAVE_API double octave_Inf;
00032
00033
00034 extern OCTAVE_API double octave_NA;
00035
00036
00037 extern OCTAVE_API double octave_NaN;
00038
00039
00040 extern OCTAVE_API float octave_Float_Inf;
00041
00042
00043 extern OCTAVE_API float octave_Float_NA;
00044
00045
00046 extern OCTAVE_API float octave_Float_NaN;
00047
00048
00049
00050
00051 extern OCTAVE_API int lo_ieee_hw;
00052 extern OCTAVE_API int lo_ieee_lw;
00053
00054 typedef union
00055 {
00056 double value;
00057 unsigned int word[2];
00058 } lo_ieee_double;
00059
00060 typedef union
00061 {
00062 float value;
00063 unsigned int word;
00064 } lo_ieee_float;
00065
00066 #define LO_IEEE_NA_HW_OLD 0x7ff00000
00067 #define LO_IEEE_NA_LW_OLD 1954
00068 #define LO_IEEE_NA_HW 0x7FF840F4
00069 #define LO_IEEE_NA_LW 0x40000000
00070 #define LO_IEEE_NA_FLOAT 0x7FC207A2
00071
00072 extern OCTAVE_API void octave_ieee_init (void);
00073
00074 extern OCTAVE_API int __lo_ieee_isnan (double x);
00075 extern OCTAVE_API int __lo_ieee_finite (double x);
00076 extern OCTAVE_API int __lo_ieee_isinf (double x);
00077
00078 extern OCTAVE_API int __lo_ieee_is_NA (double);
00079 extern OCTAVE_API int __lo_ieee_is_old_NA (double);
00080 extern OCTAVE_API int __lo_ieee_is_NaN_or_NA (double) GCC_ATTR_DEPRECATED;
00081 extern OCTAVE_API double __lo_ieee_replace_old_NA (double);
00082
00083 extern OCTAVE_API double lo_ieee_inf_value (void);
00084 extern OCTAVE_API double lo_ieee_na_value (void);
00085 extern OCTAVE_API double lo_ieee_nan_value (void);
00086
00087 extern OCTAVE_API int __lo_ieee_signbit (double);
00088
00089 extern OCTAVE_API int __lo_ieee_float_isnan (float x);
00090 extern OCTAVE_API int __lo_ieee_float_finite (float x);
00091 extern OCTAVE_API int __lo_ieee_float_isinf (float x);
00092
00093 extern OCTAVE_API int __lo_ieee_float_is_NA (float);
00094 extern OCTAVE_API int __lo_ieee_float_is_NaN_or_NA (float) GCC_ATTR_DEPRECATED;
00095
00096 extern OCTAVE_API float lo_ieee_float_inf_value (void);
00097 extern OCTAVE_API float lo_ieee_float_na_value (void);
00098 extern OCTAVE_API float lo_ieee_float_nan_value (void);
00099
00100 extern OCTAVE_API int __lo_ieee_float_signbit (float);
00101
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105
00106 #define lo_ieee_isnan(x) (sizeof (x) == sizeof (float) ? \
00107 __lo_ieee_float_isnan (x) : __lo_ieee_isnan (x))
00108 #define lo_ieee_finite(x) (sizeof (x) == sizeof (float) ? \
00109 __lo_ieee_float_finite (x) : __lo_ieee_finite (x))
00110 #define lo_ieee_isinf(x) (sizeof (x) == sizeof (float) ? \
00111 __lo_ieee_float_isinf (x) : __lo_ieee_isinf (x))
00112
00113
00114 #define lo_ieee_is_NA(x) (sizeof (x) == sizeof (float) ? \
00115 __lo_ieee_float_is_NA (x) : __lo_ieee_is_NA (x))
00116 #define lo_ieee_is_NaN_or_NA(x) (sizeof (x) == sizeof (float) ? \
00117 __lo_ieee_float_is_NaN_or_NA (x) : __lo_ieee_is_NaN_or_NA (x))
00118 #define lo_ieee_signbit(x) (sizeof (x) == sizeof (float) ? \
00119 __lo_ieee_float_signbit (x) : __lo_ieee_signbit (x))
00120
00121 #endif