Skip to content

Commit faee5a1

Browse files
committed
Back off output precision in circle.sql regression test.
We were setting extra_float_digits = 0 to avoid platform-dependent output in this test, but that's still able to expose platform-specific roundoff behavior in some new test cases added by commit a3d2844, as reported by Peter Eisentraut. Reduce it to -1 to hide that. (Over in geometry.sql, we're using -3, which is an ancient decision dating to 337f73b. I wonder whether that's overkill now. But there's probably little value in trying to change it.) Back-patch to v12 where a3d2844 came in; there's no evidence that we have any platform-dependent issues here before that. Discussion: https://postgr.es/m/15551268-e224-aa46-084a-124b64095ee3@2ndquadrant.com
1 parent f493d98 commit faee5a1

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/test/regress/expected/circle.out

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
--
22
-- CIRCLE
33
--
4-
-- avoid bit-exact output here because operations may not be bit-exact.
5-
SET extra_float_digits = 0;
4+
-- Back off displayed precision a little bit to reduce platform-to-platform
5+
-- variation in results.
6+
SET extra_float_digits = -1;
67
CREATE TABLE CIRCLE_TBL (f1 circle);
78
INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
89
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
@@ -113,12 +114,12 @@ SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
113114
five | one | two | distance
114115
------+----------------+----------------+------------------
115116
| <(3,5),0> | <(1,2),3> | 0.60555127546399
116-
| <(3,5),0> | <(5,1),3> | 1.47213595499958
117+
| <(3,5),0> | <(5,1),3> | 1.4721359549996
117118
| <(100,200),10> | <(100,1),115> | 74
118-
| <(100,200),10> | <(1,2),100> | 111.370729772479
119-
| <(1,3),5> | <(100,200),10> | 205.476756144497
119+
| <(100,200),10> | <(1,2),100> | 111.37072977248
120+
| <(1,3),5> | <(100,200),10> | 205.4767561445
120121
| <(5,1),3> | <(100,200),10> | 207.51303816328
121-
| <(3,5),0> | <(100,200),10> | 207.793480159531
122-
| <(1,2),3> | <(100,200),10> | 208.370729772479
122+
| <(3,5),0> | <(100,200),10> | 207.79348015953
123+
| <(1,2),3> | <(100,200),10> | 208.37072977248
123124
(8 rows)
124125

src/test/regress/sql/circle.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
-- CIRCLE
33
--
44

5-
-- avoid bit-exact output here because operations may not be bit-exact.
6-
SET extra_float_digits = 0;
5+
-- Back off displayed precision a little bit to reduce platform-to-platform
6+
-- variation in results.
7+
SET extra_float_digits = -1;
78

89
CREATE TABLE CIRCLE_TBL (f1 circle);
910

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy