Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 452b637

Browse filesBrowse files
committed
Adjust new test case for more portability.
Early returns from the buildfarm say that most critters are good with commit cbdb8b4, but gaur gives unexpected results with the test case involving a float8 that's one-ULP-less-than-2^63. It appears that that platform's version of rint() rounds that value up to 2^63 instead of leaving it be. This is possibly a bug, and it's also possible that no other platform anybody is using anywhere behaves likewise. Still, the point of the test is not to insist that everybody's rint() behaves exactly the same. Let's use two-ULPs-less-than-2^63 instead, which I've tested to act the same on gaur as on more modern hardware. (This is, more or less, exactly the portability issue I'd feared might arise...) Discussion: https://postgr.es/m/15519-4fc785b483201ff1@postgresql.org
1 parent cbdb8b4 commit 452b637
Copy full SHA for 452b637

File tree

Expand file treeCollapse file tree

3 files changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+5
-5
lines changed

‎src/test/regress/expected/float8-small-is-zero.out

Copy file name to clipboardExpand all lines: src/test/regress/expected/float8-small-is-zero.out
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ SELECT '-2147483648.4'::float8::int4;
511511

512512
SELECT '-2147483648.6'::float8::int4;
513513
ERROR: integer out of range
514-
SELECT '9223372036854774784'::float8::int8;
514+
SELECT '9223372036854773760'::float8::int8;
515515
int8
516516
---------------------
517-
9223372036854774784
517+
9223372036854773760
518518
(1 row)
519519

520520
SELECT '9223372036854775807'::float8::int8;

‎src/test/regress/expected/float8.out

Copy file name to clipboardExpand all lines: src/test/regress/expected/float8.out
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,10 @@ SELECT '-2147483648.4'::float8::int4;
513513

514514
SELECT '-2147483648.6'::float8::int4;
515515
ERROR: integer out of range
516-
SELECT '9223372036854774784'::float8::int8;
516+
SELECT '9223372036854773760'::float8::int8;
517517
int8
518518
---------------------
519-
9223372036854774784
519+
9223372036854773760
520520
(1 row)
521521

522522
SELECT '9223372036854775807'::float8::int8;

‎src/test/regress/sql/float8.sql

Copy file name to clipboardExpand all lines: src/test/regress/sql/float8.sql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SELECT '2147483647.4'::float8::int4;
183183
SELECT '2147483647.6'::float8::int4;
184184
SELECT '-2147483648.4'::float8::int4;
185185
SELECT '-2147483648.6'::float8::int4;
186-
SELECT '9223372036854774784'::float8::int8;
186+
SELECT '9223372036854773760'::float8::int8;
187187
SELECT '9223372036854775807'::float8::int8;
188188
SELECT '-9223372036854775808.5'::float8::int8;
189189
SELECT '-9223372036854780000'::float8::int8;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.