Returns the hyperbolic sine of a numeric value.
Syntax
sinh(<number>) → DOUBLE | DECIMALParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
number | DOUBLE or DECIMAL | Yes | The hyperbolic angle to evaluate. STRING and BIGINT inputs are implicitly converted to DOUBLE before calculation. |
Return value
| Input type | Return type |
|---|---|
| DOUBLE | DOUBLE |
| DECIMAL | DECIMAL |
| STRING | DOUBLE |
| BIGINT | DOUBLE |
| NULL | NULL |
Examples
Static values
-- Returns 5.343237290762231E12.
SELECT sinh(30);
-- Returns NULL.
SELECT sinh(null);Table data
The following example uses the mf_math_fun_t sample table. To create the table and insert sample data, run:
CREATE TABLE IF NOT EXISTS mf_math_fun_t(
int_data INT,
bigint_data BIGINT,
double_data DOUBLE,
decimal_data DECIMAL,
float_data FLOAT,
string_data STRING
);
INSERT INTO mf_math_fun_t VALUES
(null, -10, 0.525, 0.525BD, CAST(0.525 AS FLOAT), '10'),
(-20, null, -0.1, -0.1BD, CAST(-0.1 AS FLOAT), '-10'),
(0, -1, null, 20.45BD, CAST(-1 AS FLOAT), '30'),
(-40, 4, 0.89, null, CAST(0.89 AS FLOAT), '-30'),
(5, -50, -1, -1BD, null, '50'),
(-60, 6, 1.5, 1.5BD, CAST(1.5 AS FLOAT), '-50'),
(-1, -70, -7.5, -7.5BD, CAST(-7.5 AS FLOAT), null),
(-80, 1, -10.2, -10.2BD, CAST(-10.2 AS FLOAT), '-1'),
(9, -90, 2.58, 2.58BD, CAST(2.58 AS FLOAT), '0'),
(-100, 10, -5.8, -5.8BD, CAST(-5.8 AS FLOAT), '-90');Sample table data:
+------------+-------------+-------------+--------------+------------+-------------+
| int_data | bigint_data | double_data | decimal_data | float_data | string_data |
+------------+-------------+-------------+--------------+------------+-------------+
| NULL | -10 | 0.525 | 0.525 | 0.525 | 10 |
| -20 | NULL | -0.1 | -0.1 | -0.1 | -10 |
| 0 | -1 | NULL | 20.45 | -1.0 | 30 |
| -40 | 4 | 0.89 | NULL | 0.89 | -30 |
| 5 | -50 | -1.0 | -1 | NULL | 50 |
| -60 | 6 | 1.5 | 1.5 | 1.5 | -50 |
| -1 | -70 | -7.5 | -7.5 | -7.5 | NULL |
| -80 | 1 | -10.2 | -10.2 | -10.2 | -1 |
| 9 | -90 | 2.58 | 2.58 | 2.58 | 0 |
| -100 | 10 | -5.8 | -5.8 | -5.8 | -90 |
+------------+-------------+-------------+--------------+------------+-------------+The following statement calculates the hyperbolic sine for each numeric column:
SELECT sinh(bigint_data) AS bigint_new,
sinh(double_data) AS double_new,
sinh(decimal_data) AS decimal_new,
sinh(string_data) AS string_new
FROM mf_math_fun_t;Result:
+------------------------+----------------------+----------------------+-----------------------+
| bigint_new | double_new | decimal_new | string_new |
+------------------------+----------------------+----------------------+-----------------------+
| -11013.232874703393 | 0.5494517420061382 | 0.5494517420061382 | 11013.232874703393 |
| NULL | -0.10016675001984403 | -0.10016675001984403 | -11013.232874703393 |
| -1.1752011936438014 | NULL | 380445243.96844625 | 5343237290762.231 |
| 27.28991719712775 | 1.0122369492687646 | NULL | -5343237290762.231 |
| -2.592352764293536e21 | -1.1752011936438014 | -1.1752011936438014 | 2.592352764293536e21 |
| 201.71315737027922 | 2.1292794550948173 | 2.1292794550948173 | -2.592352764293536e21 |
| -1.2577193354595834e30 | -904.0209306858466 | -904.0209306858466 | NULL |
| 1.1752011936438014 | -13451.593018563612 | -13451.593018563612 | -1.1752011936438014 |
| -6.102016471589204e38 | 6.560682077817757 | 6.560682077817757 | 0.0 |
| 11013.232874703393 | -165.1482661774516 | -165.1482661774516 | -6.102016471589204e38 |
+------------------------+----------------------+----------------------+-----------------------+Related functions
SINH is a mathematical function. For more information, see Mathematical functions.