diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-03-15 03:29:22 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-03-15 03:29:22 +0000 |
commit | 1bc2d544b979164a276f9e6052f0b6d23af59b60 (patch) | |
tree | 5373cea0da5a2587783dd5b805c90427143c7555 /src/backend/utils/adt/numeric.c | |
parent | 89ab5c4abf48de8156b9284dda869f9ea2b2ad44 (diff) | |
download | postgresql-1bc2d544b979164a276f9e6052f0b6d23af59b60.tar.gz postgresql-1bc2d544b979164a276f9e6052f0b6d23af59b60.zip |
Localize our dependencies on the way to create NAN or INFINITY.
Per recent proposal to pghackers.
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
-rw-r--r-- | src/backend/utils/adt/numeric.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index f093c414ee5..341bd9cc4c5 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -14,7 +14,7 @@ * Copyright (c) 1998-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.71 2004/02/04 01:11:47 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.72 2004/03/15 03:29:22 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -43,15 +43,6 @@ /* ---------- - * Local definitions - * ---------- - */ -#ifndef NAN -#define NAN (0.0/0.0) -#endif - - -/* ---------- * Local data types * * Numeric values are represented in a base-NBASE floating point format. @@ -1790,7 +1781,7 @@ numeric_float8(PG_FUNCTION_ARGS) Datum result; if (NUMERIC_IS_NAN(num)) - PG_RETURN_FLOAT8(NAN); + PG_RETURN_FLOAT8(get_float8_nan()); tmp = DatumGetCString(DirectFunctionCall1(numeric_out, NumericGetDatum(num))); @@ -1811,7 +1802,7 @@ numeric_float8_no_overflow(PG_FUNCTION_ARGS) double val; if (NUMERIC_IS_NAN(num)) - PG_RETURN_FLOAT8(NAN); + PG_RETURN_FLOAT8(get_float8_nan()); val = numeric_to_double_no_overflow(num); @@ -1850,7 +1841,7 @@ numeric_float4(PG_FUNCTION_ARGS) Datum result; if (NUMERIC_IS_NAN(num)) - PG_RETURN_FLOAT4((float4) NAN); + PG_RETURN_FLOAT4(get_float4_nan()); tmp = DatumGetCString(DirectFunctionCall1(numeric_out, NumericGetDatum(num))); |