summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/float8.out
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>2000-01-04 16:19:34 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>2000-01-04 16:19:34 +0000
commitf54668d6179efdb4476b4f08d987f4ca7b10b303 (patch)
tree7f81c372eb1c6e95ced4150ac098d2b2ecab919b /src/test/regress/expected/float8.out
parent3ec826f99a016b6cfe47db7ebbea21f46486680e (diff)
downloadpostgresql-f54668d6179efdb4476b4f08d987f4ca7b10b303.tar.gz
Match results with format from new psql.
All of these tests have been completely inspected and give correct results.
Diffstat (limited to 'src/test/regress/expected/float8.out')
-rw-r--r--src/test/regress/expected/float8.out340
1 files changed, 176 insertions, 164 deletions
diff --git a/src/test/regress/expected/float8.out b/src/test/regress/expected/float8.out
index 90f7bc37c8..fc7b3779d7 100644
--- a/src/test/regress/expected/float8.out
+++ b/src/test/regress/expected/float8.out
@@ -1,234 +1,246 @@
-QUERY: CREATE TABLE FLOAT8_TBL(f1 float8);
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-QUERY: SELECT '' AS five, FLOAT8_TBL.*;
-five|f1
-----+--------------------
- |0
- |1004.3
- |-34.84
- |1.2345678901234e+200
- |1.2345678901234e-200
+--
+-- FLOAT8
+--
+CREATE TABLE FLOAT8_TBL(f1 float8);
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+SELECT '' AS five, FLOAT8_TBL.*;
+ five | f1
+------+----------------------
+ | 0
+ | 1004.3
+ | -34.84
+ | 1.2345678901234e+200
+ | 1.2345678901234e-200
(5 rows)
-QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
-four|f1
-----+--------------------
- |0
- |-34.84
- |1.2345678901234e+200
- |1.2345678901234e-200
+SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
+ four | f1
+------+----------------------
+ | 0
+ | -34.84
+ | 1.2345678901234e+200
+ | 1.2345678901234e-200
(4 rows)
-QUERY: SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
-one| f1
----+------
- |1004.3
+SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
+ one | f1
+-----+--------
+ | 1004.3
(1 row)
-QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
-three| f1
------+--------------------
- | 0
- | -34.84
- |1.2345678901234e-200
+SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
+ three | f1
+-------+----------------------
+ | 0
+ | -34.84
+ | 1.2345678901234e-200
(3 rows)
-QUERY: SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
-three| f1
------+--------------------
- | 0
- | -34.84
- |1.2345678901234e-200
+SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
+ three | f1
+-------+----------------------
+ | 0
+ | -34.84
+ | 1.2345678901234e-200
(3 rows)
-QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
-four| f1
-----+--------------------
- | 0
- | 1004.3
- | -34.84
- |1.2345678901234e-200
+SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
+ four | f1
+------+----------------------
+ | 0
+ | 1004.3
+ | -34.84
+ | 1.2345678901234e-200
(4 rows)
-QUERY: SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
-four| f1
-----+--------------------
- | 0
- | 1004.3
- | -34.84
- |1.2345678901234e-200
+SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
+ four | f1
+------+----------------------
+ | 0
+ | 1004.3
+ | -34.84
+ | 1.2345678901234e-200
(4 rows)
-QUERY: SELECT '' AS three, f.f1, f.f1 * '-10' AS x
+SELECT '' AS three, f.f1, f.f1 * '-10' AS x
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |x
------+--------------------+---------------------
- |1004.3 |-10043
- |1.2345678901234e+200|-1.2345678901234e+201
- |1.2345678901234e-200|-1.2345678901234e-199
+ three | f1 | x
+-------+----------------------+-----------------------
+ | 1004.3 | -10043
+ | 1.2345678901234e+200 | -1.2345678901234e+201
+ | 1.2345678901234e-200 | -1.2345678901234e-199
(3 rows)
-QUERY: SELECT '' AS three, f.f1, f.f1 + '-10' AS x
+SELECT '' AS three, f.f1, f.f1 + '-10' AS x
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |x
------+--------------------+--------------------
- |1004.3 |994.3
- |1.2345678901234e+200|1.2345678901234e+200
- |1.2345678901234e-200|-10
+ three | f1 | x
+-------+----------------------+----------------------
+ | 1004.3 | 994.3
+ | 1.2345678901234e+200 | 1.2345678901234e+200
+ | 1.2345678901234e-200 | -10
(3 rows)
-QUERY: SELECT '' AS three, f.f1, f.f1 / '-10' AS x
+SELECT '' AS three, f.f1, f.f1 / '-10' AS x
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |x
------+--------------------+---------------------
- |1004.3 |-100.43
- |1.2345678901234e+200|-1.2345678901234e+199
- |1.2345678901234e-200|-1.2345678901234e-201
+ three | f1 | x
+-------+----------------------+-----------------------
+ | 1004.3 | -100.43
+ | 1.2345678901234e+200 | -1.2345678901234e+199
+ | 1.2345678901234e-200 | -1.2345678901234e-201
(3 rows)
-QUERY: SELECT '' AS three, f.f1, f.f1 - '-10' AS x
+SELECT '' AS three, f.f1, f.f1 - '-10' AS x
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |x
------+--------------------+--------------------
- |1004.3 |1014.3
- |1.2345678901234e+200|1.2345678901234e+200
- |1.2345678901234e-200|10
+ three | f1 | x
+-------+----------------------+----------------------
+ | 1004.3 | 1014.3
+ | 1.2345678901234e+200 | 1.2345678901234e+200
+ | 1.2345678901234e-200 | 10
(3 rows)
-QUERY: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
+SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
FROM FLOAT8_TBL f where f.f1 = '1004.3';
-one| square_f1
----+----------
- |1008618.49
+ one | square_f1
+-----+------------
+ | 1008618.49
(1 row)
-QUERY: SELECT '' AS five, f.f1, @f.f1 AS abs_f1
+-- absolute value
+SELECT '' AS five, f.f1, @f.f1 AS abs_f1
FROM FLOAT8_TBL f;
-five|f1 |abs_f1
-----+--------------------+--------------------
- |0 |0
- |1004.3 |1004.3
- |-34.84 |34.84
- |1.2345678901234e+200|1.2345678901234e+200
- |1.2345678901234e-200|1.2345678901234e-200
+ five | f1 | abs_f1
+------+----------------------+----------------------
+ | 0 | 0
+ | 1004.3 | 1004.3
+ | -34.84 | 34.84
+ | 1.2345678901234e+200 | 1.2345678901234e+200
+ | 1.2345678901234e-200 | 1.2345678901234e-200
(5 rows)
-QUERY: SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
+-- truncate
+SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
FROM FLOAT8_TBL f;
-five|f1 |trunc_f1
-----+--------------------+--------------------
- |0 |0
- |1004.3 |1004
- |-34.84 |-34
- |1.2345678901234e+200|1.2345678901234e+200
- |1.2345678901234e-200|0
+ five | f1 | trunc_f1
+------+----------------------+----------------------
+ | 0 | 0
+ | 1004.3 | 1004
+ | -34.84 | -34
+ | 1.2345678901234e+200 | 1.2345678901234e+200
+ | 1.2345678901234e-200 | 0
(5 rows)
-QUERY: SELECT '' AS five, f.f1, f.f1 % AS round_f1
+-- round
+SELECT '' AS five, f.f1, f.f1 % AS round_f1
FROM FLOAT8_TBL f;
-five|f1 |round_f1
-----+--------------------+--------------------
- |0 |0
- |1004.3 |1004
- |-34.84 |-35
- |1.2345678901234e+200|1.2345678901234e+200
- |1.2345678901234e-200|0
+ five | f1 | round_f1
+------+----------------------+----------------------
+ | 0 | 0
+ | 1004.3 | 1004
+ | -34.84 | -35
+ | 1.2345678901234e+200 | 1.2345678901234e+200
+ | 1.2345678901234e-200 | 0
(5 rows)
-QUERY: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
+-- square root
+SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |sqrt_f1
------+--------------------+---------------------
- |1004.3 |31.6906926399535
- |1.2345678901234e+200|1.11111110611109e+100
- |1.2345678901234e-200|1.11111110611109e-100
+ three | f1 | sqrt_f1
+-------+----------------------+-----------------------
+ | 1004.3 | 31.6906926399535
+ | 1.2345678901234e+200 | 1.11111110611109e+100
+ | 1.2345678901234e-200 | 1.11111110611109e-100
(3 rows)
-QUERY: SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
+-- take exp of ln(f.f1)
+SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
FROM FLOAT8_TBL f
WHERE f.f1 > '0.0';
-three|f1 |exp_ln_f1
------+--------------------+---------------------
- |1004.3 |1004.3
- |1.2345678901234e+200|1.23456789012338e+200
- |1.2345678901234e-200|1.23456789012339e-200
+ three | f1 | exp_ln_f1
+-------+----------------------+-----------------------
+ | 1004.3 | 1004.3
+ | 1.2345678901234e+200 | 1.23456789012338e+200
+ | 1.2345678901234e-200 | 1.23456789012339e-200
(3 rows)
-QUERY: SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
-five|f1 |cbrt_f1
-----+--------------------+--------------------
- |0 |0
- |1004.3 |10.014312837827
- |-34.84 |-3.26607421344208
- |1.2345678901234e+200|4.97933859234765e+66
- |1.2345678901234e-200|2.3112042409018e-67
+-- cube root
+SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
+ five | f1 | cbrt_f1
+------+----------------------+----------------------
+ | 0 | 0
+ | 1004.3 | 10.014312837827
+ | -34.84 | -3.26607421344208
+ | 1.2345678901234e+200 | 4.97933859234765e+66
+ | 1.2345678901234e-200 | 2.3112042409018e-67
(5 rows)
-QUERY: SELECT '' AS five, FLOAT8_TBL.*;
-five|f1
-----+--------------------
- |0
- |1004.3
- |-34.84
- |1.2345678901234e+200
- |1.2345678901234e-200
+SELECT '' AS five, FLOAT8_TBL.*;
+ five | f1
+------+----------------------
+ | 0
+ | 1004.3
+ | -34.84
+ | 1.2345678901234e+200
+ | 1.2345678901234e-200
(5 rows)
-QUERY: UPDATE FLOAT8_TBL
+UPDATE FLOAT8_TBL
SET f1 = FLOAT8_TBL.f1 * '-1'
WHERE FLOAT8_TBL.f1 > '0.0';
-QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
+SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow
-QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
+SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range
-QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
+SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero
-QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
+SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number
-QUERY: SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
+SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range
-QUERY: SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
+SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: float8div: divide by zero error
-QUERY: SELECT '' AS five, FLOAT8_TBL.*;
-five|f1
-----+---------------------
- |0
- |-34.84
- |-1004.3
- |-1.2345678901234e+200
- |-1.2345678901234e-200
+SELECT '' AS five, FLOAT8_TBL.*;
+ five | f1
+------+-----------------------
+ | 0
+ | -34.84
+ | -1004.3
+ | -1.2345678901234e+200
+ | -1.2345678901234e-200
(5 rows)
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+-- test for over and under flow
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
ERROR: Input '-10e400' is out of range for float8
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
ERROR: Input '10e-400' is out of range for float8
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
ERROR: Input '-10e-400' is out of range for float8
-QUERY: DELETE FROM FLOAT8_TBL;
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
-QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
-QUERY: SELECT '' AS five, FLOAT8_TBL.*;
-five|f1
-----+---------------------
- |0
- |-34.84
- |-1004.3
- |-1.2345678901234e+200
- |-1.2345678901234e-200
+-- maintain external table consistency across platforms
+-- delete all values and reinsert well-behaved ones
+DELETE FROM FLOAT8_TBL;
+INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
+INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
+SELECT '' AS five, FLOAT8_TBL.*;
+ five | f1
+------+-----------------------
+ | 0
+ | -34.84
+ | -1004.3
+ | -1.2345678901234e+200
+ | -1.2345678901234e-200
(5 rows)