File tree 1 file changed +4
-14
lines changed
1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 5
5
*
6
6
* 1998 Jan Wieck
7
7
*
8
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.4 1999/01/03 02:40:12 momjian Exp $
8
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.5 1999/01/03 05:30:47 momjian Exp $
9
9
*
10
10
* ----------
11
11
*/
16
16
#include <ctype.h>
17
17
#include <float.h>
18
18
#include <math.h>
19
- /*#include <nan.h> BSD/OS does not have this */
20
19
#include <errno.h>
21
20
#include <sys/types.h>
22
21
48
47
# define MAX (a ,b ) (((a)>(b)) ? (a) : (b))
49
48
#endif
50
49
50
+ #ifndef NAN
51
+ #define NAN (0.0/0.0)
52
+ #endif
51
53
52
54
53
55
/* ----------
@@ -1722,14 +1724,8 @@ numeric_float8(Numeric num)
1722
1724
1723
1725
if (NUMERIC_IS_NAN (num ))
1724
1726
{
1725
- float64 dummy = 1 ;
1726
-
1727
1727
result = (float64 )palloc (sizeof (float64data ));
1728
- #ifdef NAN
1729
1728
* result = NAN ;
1730
- #else
1731
- * result = (dummy - dummy )/(dummy - dummy ); /* generate NAN */
1732
- #endif
1733
1729
return result ;
1734
1730
}
1735
1731
@@ -1778,14 +1774,8 @@ numeric_float4(Numeric num)
1778
1774
1779
1775
if (NUMERIC_IS_NAN (num ))
1780
1776
{
1781
- float32 dummy = 1 ;
1782
-
1783
1777
result = (float32 )palloc (sizeof (float32data ));
1784
- #ifdef NAN
1785
1778
* result = NAN ;
1786
- #else
1787
- * result = (dummy - dummy )/(dummy - dummy ); /* generate NAN */
1788
- #endif
1789
1779
return result ;
1790
1780
}
1791
1781
You can’t perform that action at this time.
0 commit comments