1967
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1967
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
1967
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
1967
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_liboctave_ieee_h) |
|
24 #define octave_liboctave_ieee_h 1 |
|
25 |
4072
|
26 #ifdef __cplusplus |
|
27 extern "C" { |
|
28 #endif |
|
29 |
4102
|
30 /* Octave's idea of infinity. */ |
6108
|
31 extern OCTAVE_API double octave_Inf; |
4102
|
32 |
|
33 /* Octave's idea of a missing value. */ |
6108
|
34 extern OCTAVE_API double octave_NA; |
4102
|
35 |
|
36 /* Octave's idea of not a number. */ |
6108
|
37 extern OCTAVE_API double octave_NaN; |
4102
|
38 |
5775
|
39 /* FIXME -- this code assumes that a double has twice the |
5388
|
40 number of bits as an int */ |
|
41 |
6108
|
42 extern OCTAVE_API int lo_ieee_hw; |
|
43 extern OCTAVE_API int lo_ieee_lw; |
4075
|
44 |
|
45 typedef union |
|
46 { |
|
47 double value; |
|
48 unsigned int word[2]; |
|
49 } lo_ieee_double; |
|
50 |
|
51 #define LO_IEEE_NA_HW 0x7ff00000 |
|
52 #define LO_IEEE_NA_LW 1954 |
|
53 |
6108
|
54 extern OCTAVE_API void octave_ieee_init (void); |
1967
|
55 |
2522
|
56 #if defined (SCO) |
4074
|
57 extern int isnan (double); |
|
58 extern int isinf (double); |
4072
|
59 #endif |
|
60 |
6108
|
61 extern OCTAVE_API int lo_ieee_isnan (double x); |
|
62 extern OCTAVE_API int lo_ieee_finite (double x); |
|
63 extern OCTAVE_API int lo_ieee_isinf (double x); |
4072
|
64 |
6108
|
65 extern OCTAVE_API int lo_ieee_is_NA (double); |
|
66 extern OCTAVE_API int lo_ieee_is_NaN_or_NA (double) GCC_ATTR_DEPRECATED; |
4075
|
67 |
6108
|
68 extern OCTAVE_API double lo_ieee_inf_value (void); |
|
69 extern OCTAVE_API double lo_ieee_na_value (void); |
|
70 extern OCTAVE_API double lo_ieee_nan_value (void); |
4102
|
71 |
6108
|
72 extern OCTAVE_API int lo_ieee_signbit (double); |
4349
|
73 |
4072
|
74 #ifdef __cplusplus |
|
75 } |
2522
|
76 #endif |
|
77 |
1967
|
78 #endif |
|
79 |
|
80 /* |
|
81 ;;; Local Variables: *** |
|
82 ;;; mode: C++ *** |
|
83 ;;; End: *** |
|
84 */ |