@ -454,24 +454,25 @@ SELECT '' AS five, * FROM FLOAT8_TBL;
| -1.2345678901234e-200
| -1.2345678901234e-200
(5 rows)
(5 rows)
RESET extra_float_digits;
-- hyperbolic functions
-- hyperbolic functions
-- we run these with extra_float_digits = 0 too, since different platforms
-- tend to produce results that vary in the last place.
SELECT sinh(float8 '1');
SELECT sinh(float8 '1');
sinh
sinh
--------------------
-----------------
1.1752011936438014
1.1752011936438
(1 row)
(1 row)
SELECT cosh(float8 '1');
SELECT cosh(float8 '1');
cosh
cosh
--------------------
------------------
1.5430806348152437
1.54308063481524
(1 row)
(1 row)
SELECT tanh(float8 '1');
SELECT tanh(float8 '1');
tanh
tanh
--------------------
-------------------
0.7615941559557649
0.761594155955765
(1 row)
(1 row)
SELECT asinh(float8 '1');
SELECT asinh(float8 '1');
@ -481,17 +482,115 @@ SELECT asinh(float8 '1');
(1 row)
(1 row)
SELECT acosh(float8 '2');
SELECT acosh(float8 '2');
acosh
acosh
--------------------
------------------
1.3169578969248166
1.31695789692482
(1 row)
(1 row)
SELECT atanh(float8 '0.5');
SELECT atanh(float8 '0.5');
atanh
atanh
--------------------
-------------------
0.5493061443340548
0.549306144334055
(1 row)
-- test Inf/NaN cases for hyperbolic functions
SELECT sinh(float8 'infinity');
sinh
----------
Infinity
(1 row)
SELECT sinh(float8 '-infinity');
sinh
-----------
-Infinity
(1 row)
SELECT sinh(float8 'nan');
sinh
------
NaN
(1 row)
SELECT cosh(float8 'infinity');
cosh
----------
Infinity
(1 row)
SELECT cosh(float8 '-infinity');
cosh
----------
Infinity
(1 row)
SELECT cosh(float8 'nan');
cosh
------
NaN
(1 row)
SELECT tanh(float8 'infinity');
tanh
------
1
(1 row)
(1 row)
SELECT tanh(float8 '-infinity');
tanh
------
-1
(1 row)
SELECT tanh(float8 'nan');
tanh
------
NaN
(1 row)
SELECT asinh(float8 'infinity');
asinh
----------
Infinity
(1 row)
SELECT asinh(float8 '-infinity');
asinh
-----------
-Infinity
(1 row)
SELECT asinh(float8 'nan');
asinh
-------
NaN
(1 row)
SELECT acosh(float8 'infinity');
acosh
----------
Infinity
(1 row)
SELECT acosh(float8 '-infinity');
ERROR: input is out of range
SELECT acosh(float8 'nan');
acosh
-------
NaN
(1 row)
SELECT atanh(float8 'infinity');
ERROR: input is out of range
SELECT atanh(float8 '-infinity');
ERROR: input is out of range
SELECT atanh(float8 'nan');
atanh
-------
NaN
(1 row)
RESET extra_float_digits;
-- test for over- and underflow
-- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: "10e400" is out of range for type double precision
ERROR: "10e400" is out of range for type double precision