Python math.sinh () método : Aquí, vamos a aprender sobre el método math.sinh () con el ejemplo en Python .
Python math.sinh () método
math.sinh método () está un método de biblioteca de módulo matemático , que se utiliza para obtener el seno hiperbólico del número dado en radianes, se acepta un número y devuelve el seno hiperbólico.
Nota: math.sinh () método sólo acepta números, si proporcionamos cualquier otra cosa, excepto el número, se devuelve el error TypeError – “TypeError: se requiere un class” .
método
Sintaxis de math.sinh ():
math.sinh(x)
Parámetro (s): x – es el número cuyo seno hiperbólico que ser calculados.
float valor: class – devuelve un valor Return que es el valor del seno hiperbólico del número x .
Ejemplo:
Input:
x = 1.5
# function call
print(math.sinh(x))
Output:
2.1292794550948173
código Python para demostrar método ejemplo de math.sinh ()
# Python code to demonstrate example of
# math.sinh() method
# importing math module
import math
# number
x = -10
print("math.sinh(",x,"): ", math.sinh(x))
x = 0
print("math.sinh(",x,"): ", math.sinh(x))
x = 1.5
print("math.sinh(",x,"): ", math.sinh(x))
x = 5
print("math.sinh(",x,"): ", math.sinh(x))
x = 15.45
print("math.sinh(",x,"): ", math.sinh(x))
salida
math.sinh( -10 ): -11013.232874703393
math.sinh( 0 ): 0.0
math.sinh( 1.5 ): 2.1292794550948173
math.sinh( 5 ): 74.20321057778875
math.sinh( 15.45 ): 2563419.889913433
TypeError ejemplo
# Python code to demonstrate example of
# math.sinh() method with exception
# importing math module
import math
# number
x = "2.5"
print("math.sinh(",x,"): ", math.sinh(x))
salida
Traceback (most recent call last):
File "/home/main.py", line 9, in <module>
print("math.sinh(",x,"): ", math.sinh(x))
TypeError: a float is required