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.
REL_11_STABLE
Dean Rasheed 4 years ago
parent 4851940a5c
commit 434ddfb79a
  1. 8
      src/test/regress/expected/numeric.out
  2. 4
      src/test/regress/sql/numeric.sql

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

@ -907,12 +907,12 @@ select 3.789 ^ 35;
select 1.2 ^ 345;
select 0.12 ^ (-20);
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
select 0.12 ^ (-25);
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
select (-1.0) ^ 2147483646;

Loading…
Cancel
Save