Allow 'Infinity' and '-Infinity' as input to the float4 and float8

types. Update the regression tests and the documentation to reflect
this. Remove the UNSAFE_FLOATS #ifdef.

This is only half the story: we still unconditionally reject
floating point operations that result in +/- infinity. See
recent thread on -hackers for more information.
This commit is contained in:
Neil Conway
2004-03-12 00:25:43 +00:00
parent fe6e922136
commit bfd6f52b0e
7 changed files with 112 additions and 40 deletions

View File

@ -29,8 +29,17 @@ INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
SELECT 'NaN'::float4;
SELECT 'nan'::float4;
SELECT ' NAN '::float4;
SELECT 'infinity'::float4;
SELECT ' -INFINiTY '::float4;
-- bad special inputs
SELECT 'N A N'::float4;
SELECT 'NaN x'::float4;
SELECT ' INFINITY x'::float4;
SELECT 'Infinity'::float4 + 100.0;
SELECT 'Infinity'::float4 / 'Infinity'::float4;
SELECT 'nan'::float4 / 'nan'::float4;
SELECT '' AS five, FLOAT4_TBL.*;