mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-12 17:37:07 +08:00
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:
@ -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.*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user