aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-01-17 16:19:08 +0000
committerNeil Conway <neilc@samurai.com>2007-01-17 16:19:08 +0000
commit530b10c719eca63ca212a73aedd6beccda8b46b7 (patch)
treed2258c42e551da8fda8a80845de10f9408d721f1 /src
parent3026e1765ff2298ba8d734f1baa3908a1c96ba03 (diff)
downloadpostgresql-530b10c719eca63ca212a73aedd6beccda8b46b7.tar.gz
postgresql-530b10c719eca63ca212a73aedd6beccda8b46b7.zip
Tweak the width_bucket() regression tests to avoid an unnecessary
dependency on the platform's floating point implementation. Per report from Stefan Kaltenbrunner.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/numeric.out44
-rw-r--r--src/test/regress/sql/numeric.sql2
2 files changed, 23 insertions, 23 deletions
diff --git a/src/test/regress/expected/numeric.out b/src/test/regress/expected/numeric.out
index 3780c17e5a9..7840990bf7d 100644
--- a/src/test/regress/expected/numeric.out
+++ b/src/test/regress/expected/numeric.out
@@ -754,7 +754,7 @@ CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
COPY width_bucket_test (operand_num) FROM stdin;
UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
SELECT
- operand_num, operand_f8,
+ operand_num,
width_bucket(operand_num, 0, 10, 5) AS wb_1,
width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
width_bucket(operand_num, 10, 0, 5) AS wb_2,
@@ -766,27 +766,27 @@ SELECT
width_bucket(operand_num, -25, 25, 10) AS wb_5,
width_bucket(operand_f8, -25, 25, 10) AS wb_5f
FROM width_bucket_test;
- operand_num | operand_f8 | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f
-------------------+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
- -5.2 | -5.2 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 4 | 4
- -0.0000000001 | -1e-10 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 5 | 5
- 0.000000000001 | 1e-12 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
- 1 | 1 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
- 1.99999999999999 | 1.99999999999999 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
- 2 | 2 | 2 | 2 | 5 | 5 | 1 | 1 | 0 | 0 | 6 | 6
- 2.00000000000001 | 2.00000000000001 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
- 3 | 3 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
- 4 | 4 | 3 | 3 | 4 | 4 | 2 | 2 | 0 | 0 | 6 | 6
- 4.5 | 4.5 | 3 | 3 | 3 | 3 | 2 | 2 | 0 | 0 | 6 | 6
- 5 | 5 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 7 | 7
- 5.5 | 5.5 | 3 | 3 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
- 6 | 6 | 4 | 4 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
- 7 | 7 | 4 | 4 | 2 | 2 | 4 | 4 | 21 | 21 | 7 | 7
- 8 | 8 | 5 | 5 | 2 | 2 | 5 | 5 | 21 | 21 | 7 | 7
- 9 | 9 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
- 9.99999999999999 | 9.99999999999999 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
- 10 | 10 | 6 | 6 | 1 | 1 | 5 | 5 | 21 | 21 | 8 | 8
- 10.0000000000001 | 10.0000000000001 | 6 | 6 | 0 | 0 | 5 | 5 | 21 | 21 | 8 | 8
+ operand_num | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f
+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
+ -5.2 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 4 | 4
+ -0.0000000001 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 5 | 5
+ 0.000000000001 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 1 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 1.99999999999999 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
+ 2 | 2 | 2 | 5 | 5 | 1 | 1 | 0 | 0 | 6 | 6
+ 2.00000000000001 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
+ 3 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
+ 4 | 3 | 3 | 4 | 4 | 2 | 2 | 0 | 0 | 6 | 6
+ 4.5 | 3 | 3 | 3 | 3 | 2 | 2 | 0 | 0 | 6 | 6
+ 5 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 7 | 7
+ 5.5 | 3 | 3 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
+ 6 | 4 | 4 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
+ 7 | 4 | 4 | 2 | 2 | 4 | 4 | 21 | 21 | 7 | 7
+ 8 | 5 | 5 | 2 | 2 | 5 | 5 | 21 | 21 | 7 | 7
+ 9 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
+ 9.99999999999999 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
+ 10 | 6 | 6 | 1 | 1 | 5 | 5 | 21 | 21 | 8 | 8
+ 10.0000000000001 | 6 | 6 | 0 | 0 | 5 | 5 | 21 | 21 | 8 | 8
(19 rows)
-- for float8 only, check positive and negative infinity: we require
diff --git a/src/test/regress/sql/numeric.sql b/src/test/regress/sql/numeric.sql
index eacc4b5b73f..dc1452f9ef0 100644
--- a/src/test/regress/sql/numeric.sql
+++ b/src/test/regress/sql/numeric.sql
@@ -708,7 +708,7 @@ COPY width_bucket_test (operand_num) FROM stdin;
UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
SELECT
- operand_num, operand_f8,
+ operand_num,
width_bucket(operand_num, 0, 10, 5) AS wb_1,
width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
width_bucket(operand_num, 10, 0, 5) AS wb_2,