Published Oct 23, 2023
Contribute to Docs

The math.sinh() method in Kotlin’s math class is used to calculate the hyperbolic sine of a given number.


import kotlin.math.sinh
val hyperbolicSine = sinh(number)
  • number: The number, of type Double or Float, to be used in the calculation of the hyperbolic sine.


This example shows how to use the sinh() method to calculate the hyperbolic sine of a number:

import kotlin.math.sinh
fun main() {
val number = 2.0
val hyperbolicSine = sinh(number)
println("The hyperbolic sine of $number is $hyperbolicSine.")

The code above will result in the following output:

The hyperbolic sine of 2.0 is 3.6268604078470186.

All contributors

Looking to contribute?

Learn Kotlin on Codecademy