sinh()
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.
Syntax
import kotlin.math.sinh
val hyperbolicSine = sinh(number)
number
: The number, of typeDouble
orFloat
, to be used in the calculation of the hyperbolic sine.
Example
This example shows how to use the sinh()
method to calculate the hyperbolic sine of a number:
import kotlin.math.sinhfun main() {val number = 2.0val 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.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Kotlin on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Kotlin
Learn Kotlin, the expressive, open-source programming language developed by JetBrains.Beginner Friendly9 hours