python math.sinh_带有Python示例的math.sinh()方法
Python math.sinh() 方法
math.sinh()方法是数学模块的一种库方法,用于获取以弧度为单位的给定数字的双曲正弦值,它接受一个数字并返回双曲正弦值。
注意: math.sinh()方法仅接受数字,如果我们提供除数字以外的其他任何内容,它将返回错误TypeError – “ TypeError:需要浮点数”。
它的语法 math.sinh() 方法:
math.sinh(x)
Parameter(s): x –是要计算其双曲正弦值的数字。
返回值: float-它返回一个浮点值,它是数字x的双曲正弦值。
示例
Input:
x = 1.5
# 函数调用
print(math.sinh(x))
Output:
2.1292794550948173
Python代码演示示例 math.sinh() 方法
# Python代码演示示例
# math.sinh() method
# 导入数学模块
import math
# 数
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))
输出结果
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示例
# Python代码演示示例
# math.sinh() method with exception
# 导入数学模块
import math
# 数
x = "2.5"
print("math.sinh(",x,"): ", math.sinh(x))
输出结果
Traceback (most recent call last):
File "/home/main.py", line 9, in
print("math.sinh(",x,"): ", math.sinh(x))
TypeError: a float is required
python math.sinh_带有Python示例的math.sinh()方法相关推荐
- sinh_带有Python示例的math.sinh()方法
sinh Python math.sinh()方法 (Python math.sinh() method) math.sinh() method is a library method of math ...
- math.trunc_带有Python示例的math.trunc()方法
math.trunc Python math.trunc()方法 (Python math.trunc() method) math.trunc() method is a library metho ...
- math.atan2_带有Python示例的math.atan2()方法
math.atan2 Python math.atan2()方法 (Python math.atan2() method) math.atan2() method is a library metho ...
- python中acosh_带有Python示例的math.acosh()方法
python中acosh Python math.acosh()方法 (Python math.acosh() method) math.acosh() method is a library met ...
- js math.hypot_带有Python示例的math.hypot()方法
js math.hypot Python math.hypot()方法 (Python math.hypot() method) math.hypot() method is a library me ...
- math.fabs_带有Python示例的math.fabs()方法
math.fabs Python math.fabs()方法 (Python math.fabs() method) math.fabs() method is a library method of ...
- python 语音识别_带有Python的AI –语音识别
python 语音识别 带有Python的AI –语音识别 (AI with Python – Speech Recognition) In this chapter, we will learn a ...
- python遗传算法_带有Python的AI –遗传算法
python遗传算法 带有Python的AI –遗传算法 (AI with Python – Genetic Algorithms) This chapter discusses Genetic Al ...
- python教程cos_带有Python示例的math.cos()方法
Python math.cos() 方法 math.cos()方法是数学模块的库方法,用于获取弧度数的余弦值,它接受一个数字,返回给定弧度的余弦值. 注意: math.cos()方法接受的唯一的号码, ...
最新文章
- mysql left join,right join,inner join用法分析
- 困扰一天啦,求大神不吝指导,Camera的onPreviewFrame中的问题
- C# 浅拷贝与深拷贝区别 解惑篇
- 使用Nginx自带的Realip模块获取用户真实IP
- graphql入门_GraphQL入门指南
- web前端编程语言有哪些?
- Android4火狐,Android版火狐4正式发布
- spark TF-IDF入门
- postgresql触发器实例
- android看图3D,一个相见恨晚的3D手机看图神器,工作效率飙升10倍!
- 微信小程序 实时音视频通话
- 西安华为 java研发工程师_【华为西安研究所工资】研发工程师待遇-看准网
- python3实现图片虚化显示轮廓
- cf 936B Sleepy Game
- Python 后台启动程序
- C补习--------->第六天,二级指针、指针和数组的关系、选择排序
- matlab波形相似系数,如何用matlab计算波形相似系数
- python编程从入门到实践django-首页
- java记事本(一)
- .net mvc core网站发布的几种方式