diff --git a/src/test/regress/expected/float8-exp-three-digits-win32.out b/src/test/regress/expected/float8-exp-three-digits-win32.out index 2dd648d6b92..fe97af0029b 100644 --- a/src/test/regress/expected/float8-exp-three-digits-win32.out +++ b/src/test/regress/expected/float8-exp-three-digits-win32.out @@ -24,6 +24,25 @@ SELECT '-10e-400'::float8; ERROR: "-10e-400" is out of range for type double precision LINE 1: SELECT '-10e-400'::float8; ^ +-- test whether denormalized values are accepted +SELECT '4.95e-324'::float8 < '1.49e-323'::float8; + ?column? +---------- + t +(1 row) + +SELECT '4.95e-324'::float8 > '0'::float8; + ?column? +---------- + t +(1 row) + +SELECT substr('-4.95e-324'::float8::text, 1, 4); + substr +-------- + -4.9 +(1 row) + -- bad input INSERT INTO FLOAT8_TBL(f1) VALUES (''); ERROR: invalid input syntax for type double precision: "" diff --git a/src/test/regress/expected/float8-small-is-zero.out b/src/test/regress/expected/float8-small-is-zero.out index 5da743374c9..2bf2e6ce607 100644 --- a/src/test/regress/expected/float8-small-is-zero.out +++ b/src/test/regress/expected/float8-small-is-zero.out @@ -24,6 +24,25 @@ SELECT '10e-400'::float8; SELECT '-10e-400'::float8; float8 +-- test whether denormalized values are accepted +SELECT '4.95e-324'::float8 < '1.49e-323'::float8; + ?column? +---------- + t +(1 row) + +SELECT '4.95e-324'::float8 > '0'::float8; + ?column? +---------- + t +(1 row) + +SELECT substr('-4.95e-324'::float8::text, 1, 4); + substr +-------- + -4.9 +(1 row) + -------- -0 (1 row) diff --git a/src/test/regress/expected/float8-small-is-zero_1.out b/src/test/regress/expected/float8-small-is-zero_1.out index 530842e1023..b276eeca4f2 100644 --- a/src/test/regress/expected/float8-small-is-zero_1.out +++ b/src/test/regress/expected/float8-small-is-zero_1.out @@ -24,6 +24,25 @@ SELECT '10e-400'::float8; SELECT '-10e-400'::float8; float8 +-- test whether denormalized values are accepted +SELECT '4.95e-324'::float8 < '1.49e-323'::float8; + ?column? +---------- + t +(1 row) + +SELECT '4.95e-324'::float8 > '0'::float8; + ?column? +---------- + t +(1 row) + +SELECT substr('-4.95e-324'::float8::text, 1, 4); + substr +-------- + -4.9 +(1 row) + -------- 0 (1 row) diff --git a/src/test/regress/expected/float8.out b/src/test/regress/expected/float8.out index 6221538af5c..df6ec9c58c7 100644 --- a/src/test/regress/expected/float8.out +++ b/src/test/regress/expected/float8.out @@ -24,6 +24,25 @@ SELECT '-10e-400'::float8; ERROR: "-10e-400" is out of range for type double precision LINE 1: SELECT '-10e-400'::float8; ^ +-- test whether denormalized values are accepted +SELECT '4.95e-324'::float8 < '1.49e-323'::float8; + ?column? +---------- + t +(1 row) + +SELECT '4.95e-324'::float8 > '0'::float8; + ?column? +---------- + t +(1 row) + +SELECT substr('-4.95e-324'::float8::text, 1, 4); + substr +-------- + -4.9 +(1 row) + -- bad input INSERT INTO FLOAT8_TBL(f1) VALUES (''); ERROR: invalid input syntax for type double precision: "" diff --git a/src/test/regress/sql/float8.sql b/src/test/regress/sql/float8.sql index 92a574ab7bf..1f24556fed4 100644 --- a/src/test/regress/sql/float8.sql +++ b/src/test/regress/sql/float8.sql @@ -16,6 +16,11 @@ SELECT '-10e400'::float8; SELECT '10e-400'::float8; SELECT '-10e-400'::float8; +-- test whether denormalized values are accepted +SELECT '4.95e-324'::float8 < '1.49e-323'::float8; +SELECT '4.95e-324'::float8 > '0'::float8; +SELECT substr('-4.95e-324'::float8::text, 1, 4); + -- bad input INSERT INTO FLOAT8_TBL(f1) VALUES (''); INSERT INTO FLOAT8_TBL(f1) VALUES (' ');