mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Convert float8 regress test to use exp() and ln() instead of ':' and
';' operators.
This commit is contained in:
parent
7f116a6b83
commit
72b4086711
@ -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;
|
|||||||
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
|
|||||||
(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;
|
|||||||
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
|
|||||||
(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;
|
|||||||
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
|
|||||||
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;
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user