Skip to main content

sinh

1. SINH Function

The SINH function in H2 database is used to calculate the hyperbolic sine of a given number.

2. Syntax

The syntax for the SINH function in H2 database is as follows:

SINH(number)

Arguments

  • number: The number for which the hyperbolic sine needs to be calculated. It should be a numeric value.

Return

  • The SINH function returns the hyperbolic sine of the given number.

3. Notes

  • The SINH function in H2 database calculates the hyperbolic sine using the exponential function, where sinh(x) = (e^x - e^(-x)) / 2.
  • The input number can be positive, negative, or zero.
  • If the input number exceeds the numeric range, the SINH function will return NULL.
  • Ensure that the correct syntax and datatype are used while using the SINH function to avoid errors.

4. Examples

Here are a few examples demonstrating the usage of the SINH function in H2 database:

Example 1 - Calculating the hyperbolic sine of a number:

SELECT SINH(2) AS sinh_value;

Output:

sinh_value
----------
3.6268604078470186

Example 2 - Calculating the hyperbolic sine of numbers stored in a column:

CREATE TABLE numbers (
id INT PRIMARY KEY,
value DOUBLE
);

INSERT INTO numbers VALUES (1, 0.5), (2, 1.2), (3, -0.8);

SELECT id, value, SINH(value) AS sinh_value
FROM numbers;

Output:

id | value |   sinh_value
---+-------+---------------
1 | 0.5 | 0.5210953055
2 | 1.2 | 1.5094613554
3 | -0.8 | -0.6640367703
  • cosh - Calculate hyperbolic cosine
  • tanh - Calculate hyperbolic tangent