Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 530b10c

Browse files
author
Neil Conway
committed
Tweak the width_bucket() regression tests to avoid an unnecessary
dependency on the platform's floating point implementation. Per report from Stefan Kaltenbrunner.
1 parent 3026e17 commit 530b10c

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/test/regress/expected/numeric.out

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
754754
COPY width_bucket_test (operand_num) FROM stdin;
755755
UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
756756
SELECT
757-
operand_num, operand_f8,
757+
operand_num,
758758
width_bucket(operand_num, 0, 10, 5) AS wb_1,
759759
width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
760760
width_bucket(operand_num, 10, 0, 5) AS wb_2,
@@ -766,27 +766,27 @@ SELECT
766766
width_bucket(operand_num, -25, 25, 10) AS wb_5,
767767
width_bucket(operand_f8, -25, 25, 10) AS wb_5f
768768
FROM width_bucket_test;
769-
operand_num | operand_f8 | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f
770-
------------------+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
771-
-5.2 | -5.2 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 4 | 4
772-
-0.0000000001 | -1e-10 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 5 | 5
773-
0.000000000001 | 1e-12 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
774-
1 | 1 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
775-
1.99999999999999 | 1.99999999999999 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
776-
2 | 2 | 2 | 2 | 5 | 5 | 1 | 1 | 0 | 0 | 6 | 6
777-
2.00000000000001 | 2.00000000000001 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
778-
3 | 3 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
779-
4 | 4 | 3 | 3 | 4 | 4 | 2 | 2 | 0 | 0 | 6 | 6
780-
4.5 | 4.5 | 3 | 3 | 3 | 3 | 2 | 2 | 0 | 0 | 6 | 6
781-
5 | 5 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 7 | 7
782-
5.5 | 5.5 | 3 | 3 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
783-
6 | 6 | 4 | 4 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
784-
7 | 7 | 4 | 4 | 2 | 2 | 4 | 4 | 21 | 21 | 7 | 7
785-
8 | 8 | 5 | 5 | 2 | 2 | 5 | 5 | 21 | 21 | 7 | 7
786-
9 | 9 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
787-
9.99999999999999 | 9.99999999999999 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
788-
10 | 10 | 6 | 6 | 1 | 1 | 5 | 5 | 21 | 21 | 8 | 8
789-
10.0000000000001 | 10.0000000000001 | 6 | 6 | 0 | 0 | 5 | 5 | 21 | 21 | 8 | 8
769+
operand_num | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f
770+
------------------+------+-------+------+-------+------+-------+------+-------+------+-------
771+
-5.2 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 4 | 4
772+
-0.0000000001 | 0 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 5 | 5
773+
0.000000000001 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
774+
1 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
775+
1.99999999999999 | 1 | 1 | 5 | 5 | 0 | 0 | 0 | 0 | 6 | 6
776+
2 | 2 | 2 | 5 | 5 | 1 | 1 | 0 | 0 | 6 | 6
777+
2.00000000000001 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
778+
3 | 2 | 2 | 4 | 4 | 1 | 1 | 0 | 0 | 6 | 6
779+
4 | 3 | 3 | 4 | 4 | 2 | 2 | 0 | 0 | 6 | 6
780+
4.5 | 3 | 3 | 3 | 3 | 2 | 2 | 0 | 0 | 6 | 6
781+
5 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 7 | 7
782+
5.5 | 3 | 3 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
783+
6 | 4 | 4 | 3 | 3 | 3 | 3 | 21 | 21 | 7 | 7
784+
7 | 4 | 4 | 2 | 2 | 4 | 4 | 21 | 21 | 7 | 7
785+
8 | 5 | 5 | 2 | 2 | 5 | 5 | 21 | 21 | 7 | 7
786+
9 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
787+
9.99999999999999 | 5 | 5 | 1 | 1 | 5 | 5 | 21 | 21 | 7 | 7
788+
10 | 6 | 6 | 1 | 1 | 5 | 5 | 21 | 21 | 8 | 8
789+
10.0000000000001 | 6 | 6 | 0 | 0 | 5 | 5 | 21 | 21 | 8 | 8
790790
(19 rows)
791791

792792
-- for float8 only, check positive and negative infinity: we require

src/test/regress/sql/numeric.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ COPY width_bucket_test (operand_num) FROM stdin;
708708
UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
709709

710710
SELECT
711-
operand_num, operand_f8,
711+
operand_num,
712712
width_bucket(operand_num, 0, 10, 5) AS wb_1,
713713
width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
714714
width_bucket(operand_num, 10, 0, 5) AS wb_2,

0 commit comments

Comments
 (0)