Kotlin sinh()

board4065444921's avatar
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.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn Kotlin, the expressive, open-source programming language developed by JetBrains.
    • Beginner Friendly.
      9 hours

Syntax

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.

Example

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

Contribute to Docs

Learn Kotlin on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours
  • Learn Kotlin, the expressive, open-source programming language developed by JetBrains.
    • Beginner Friendly.
      9 hours