mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Change float8-to-int8 conversion to round to nearest, rather than
truncating to integer. Remove regress test that checks whether 4567890123456789 can be converted to float without loss; since that's 52 bits, it's on the hairy edge of failing with IEEE float8s, and indeed rint seems to give platform-dependent results for it.
This commit is contained in:
@ -87,16 +87,6 @@ SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
|
||||
| -4567890123456789 | -4.56789012345679e+015
|
||||
(5 rows)
|
||||
|
||||
SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
|
||||
five | q1 | two coercions
|
||||
------+------------------+------------------
|
||||
| 123 | 123
|
||||
| 123 | 123
|
||||
| 4567890123456789 | 4567890123456789
|
||||
| 4567890123456789 | 4567890123456789
|
||||
| 4567890123456789 | 4567890123456789
|
||||
(5 rows)
|
||||
|
||||
SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
|
||||
five | twice int4
|
||||
------+------------------
|
||||
|
@ -87,16 +87,6 @@ SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
|
||||
| -4567890123456789 | -4.56789012345679e+15
|
||||
(5 rows)
|
||||
|
||||
SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
|
||||
five | q1 | two coercions
|
||||
------+------------------+------------------
|
||||
| 123 | 123
|
||||
| 123 | 123
|
||||
| 4567890123456789 | 4567890123456789
|
||||
| 4567890123456789 | 4567890123456789
|
||||
| 4567890123456789 | 4567890123456789
|
||||
(5 rows)
|
||||
|
||||
SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
|
||||
five | twice int4
|
||||
------+------------------
|
||||
|
@ -22,7 +22,6 @@ SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
|
||||
|
||||
SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
|
||||
SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
|
||||
SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
|
||||
|
||||
SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
|
||||
SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
|
||||
|
Reference in New Issue
Block a user