Commit 72b40867 authored by Tom Lane's avatar Tom Lane

Convert float8 regress test to use exp() and ln() instead of ':' and

';' operators.
parent 7f116a6b
...@@ -161,7 +161,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 ...@@ -161,7 +161,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
(3 rows) (3 rows)
-- take exp of ln(f.f1) -- take exp of ln(f.f1)
SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
three | f1 | exp_ln_f1 three | f1 | exp_ln_f1
...@@ -199,11 +199,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; ...@@ -199,11 +199,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow ERROR: Bad float8 input format -- overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range ERROR: pow() result is out of range
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero ERROR: can't take log of zero
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number ERROR: can't take log of a negative number
SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f; SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range ERROR: exp() result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: float8div: divide by zero error ERROR: float8div: divide by zero error
......
...@@ -161,7 +161,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 ...@@ -161,7 +161,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
(3 rows) (3 rows)
-- take exp of ln(f.f1) -- take exp of ln(f.f1)
SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
three | f1 | exp_ln_f1 three | f1 | exp_ln_f1
...@@ -199,11 +199,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; ...@@ -199,11 +199,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: floating point exception! The last floating point operation either exceeded legal ranges or was a divide by zero ERROR: floating point exception! The last floating point operation either exceeded legal ranges or was a divide by zero
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range ERROR: pow() result is out of range
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero ERROR: can't take log of zero
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number ERROR: can't take log of a negative number
SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f; SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range ERROR: exp() result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: float8div: divide by zero error ERROR: float8div: divide by zero error
......
...@@ -173,7 +173,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 ...@@ -173,7 +173,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
(3 rows) (3 rows)
-- take exp of ln(f.f1) -- take exp of ln(f.f1)
SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
three | f1 | exp_ln_f1 three | f1 | exp_ln_f1
...@@ -217,11 +217,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; ...@@ -217,11 +217,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
ERROR: Bad float8 input format -- overflow ERROR: Bad float8 input format -- overflow
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
ERROR: pow() result is out of range ERROR: pow() result is out of range
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
ERROR: can't take log of zero ERROR: can't take log of zero
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
ERROR: can't take log of a negative number ERROR: can't take log of a negative number
SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f; SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
ERROR: exp() result is out of range ERROR: exp() result is out of range
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
ERROR: float8div: divide by zero error ERROR: float8div: divide by zero error
......
...@@ -70,7 +70,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 ...@@ -70,7 +70,7 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
-- take exp of ln(f.f1) -- take exp of ln(f.f1)
SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
...@@ -90,11 +90,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; ...@@ -90,11 +90,11 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ; SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f; SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment