Mercurial > hg > octave-lyh
comparison liboctave/lo-cieee.c @ 4072:3cc39e3b8fa5
[project @ 2002-09-27 17:54:53 by jwe]
author | jwe |
---|---|
date | Fri, 27 Sep 2002 17:54:53 +0000 |
parents | |
children | a67f76924703 |
comparison
equal
deleted
inserted
replaced
4071:3827a03c72f0 | 4072:3cc39e3b8fa5 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 2002 John W. Eaton | |
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 | |
9 Free Software Foundation; either version 2, or (at your option) any | |
10 later version. | |
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 | |
18 along with Octave; see the file COPYING. If not, write to the Free | |
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
20 | |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include <float.h> | |
28 #include <math.h> | |
29 | |
30 #if defined (HAVE_FLOATINGPOINT_H) | |
31 #include <floatingpoint.h> | |
32 #endif | |
33 | |
34 #if defined (HAVE_IEEEFP_H) | |
35 #include <ieeefp.h> | |
36 #endif | |
37 | |
38 #if defined (HAVE_NAN_H) | |
39 #if defined (SCO) | |
40 #define _IEEE 1 | |
41 #endif | |
42 #include <nan.h> | |
43 #if defined (SCO) | |
44 #undef _IEEE | |
45 #endif | |
46 #endif | |
47 | |
48 #include "lo-ieee.h" | |
49 | |
50 #if defined (SCO) | |
51 | |
52 int | |
53 isnan (double x) | |
54 { | |
55 return (IsNANorINF (x) && NaN (x) && ! IsINF (x)) ? 1 : 0; | |
56 } | |
57 | |
58 int | |
59 isinf (double x) | |
60 { | |
61 return (IsNANorINF (x) && IsINF (x)) ? 1 : 0; | |
62 } | |
63 | |
64 #endif | |
65 | |
66 int | |
67 lo_ieee_is_NA (double x) | |
68 { | |
69 lo_ieee_double t; | |
70 t.value = x; | |
71 return (isnan (x) && t.word[lo_ieee_lw] == LO_IEEE_NA_LW) ? 1 : 0; | |
72 } | |
73 | |
74 int | |
75 lo_ieee_is_NaN_or_NA (double x) | |
76 { | |
77 return isnan (x); | |
78 } | |
79 | |
80 /* | |
81 ;;; Local Variables: *** | |
82 ;;; mode: C++ *** | |
83 ;;; End: *** | |
84 */ |