1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-09 17:03:00 +03:00

Improve numeric_power() tests for large integer powers.

Two of the tests added by 4dd5ce2fd fail on buildfarm member
castoroides, though it's not clear why. Improve the tests to report
the actual values produced, if they're not what was expected.

Apply to v11 only for now, until it's clearer what's going on.
This commit is contained in:
Dean Rasheed
2021-08-05 22:24:28 +01:00
parent 4851940a5c
commit 434ddfb79a
2 changed files with 6 additions and 6 deletions

View File

@@ -1668,10 +1668,10 @@ select 1.000000000123 ^ (-2147483648);
0.7678656556403084 0.7678656556403084
(1 row) (1 row)
select 0.9999999999 ^ 23300000000000 = 0 as rounds_to_zero; select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
rounds_to_zero rounds_to_zero
---------------- ----------------
t 0
(1 row) (1 row)
-- cases that used to error out -- cases that used to error out
@@ -1687,10 +1687,10 @@ select 0.5678 ^ (-85);
782333637740774446257.7719390061997396 782333637740774446257.7719390061997396
(1 row) (1 row)
select 0.9999999999 ^ 70000000000000 = 0 as underflows; select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
underflows underflows
------------ ------------
t 0
(1 row) (1 row)
-- negative base to integer powers -- negative base to integer powers

View File

@@ -907,12 +907,12 @@ select 3.789 ^ 35;
select 1.2 ^ 345; select 1.2 ^ 345;
select 0.12 ^ (-20); select 0.12 ^ (-20);
select 1.000000000123 ^ (-2147483648); select 1.000000000123 ^ (-2147483648);
select 0.9999999999 ^ 23300000000000 = 0 as rounds_to_zero; select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
-- cases that used to error out -- cases that used to error out
select 0.12 ^ (-25); select 0.12 ^ (-25);
select 0.5678 ^ (-85); select 0.5678 ^ (-85);
select 0.9999999999 ^ 70000000000000 = 0 as underflows; select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
-- negative base to integer powers -- negative base to integer powers
select (-1.0) ^ 2147483646; select (-1.0) ^ 2147483646;