博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sinh_带有Python示例的math.sinh()方法
阅读量:2536 次
发布时间:2019-05-11

本文共 1901 字,大约阅读时间需要 6 分钟。

sinh

Python math.sinh()方法 (Python math.sinh() method)

math.sinh() method is a library method of math module, it is used to get the hyperbolic sine of given number in radians, it accepts a number and returns hyperbolic sine.

math.sinh()方法数学模块的库方法,用于获取以弧度为单位的给定数字的双曲正弦值,它接受一个数字并返回双曲正弦值。

Note: math.sinh() method accepts only numbers, if we provide anything else except the number, it returns error TypeError"TypeError: a float is required".

注意: math.sinh()方法仅接受数字,如果我们提供除数字以外的任何其他内容,它将返回错误TypeError“ TypeError:需要浮点数”

Syntax of math.sinh() method:

math.sinh()方法的语法:

math.sinh(x)

Parameter(s): x – is the number whose hyperbolic sine to be calculated.

参数: x –是要计算其双曲正弦值的数字。

Return value: float – it returns a float value that is the hyperbolic sine value of the number x.

返回值: float-它返回一个浮点值,它是数字x的双曲正弦值。

Example:

例:

Input:    x = 1.5    # function call    print(math.sinh(x))    Output:    2.1292794550948173

Python代码演示math.sinh()方法的示例 (Python code to demonstrate example of math.sinh() method)

# Python code to demonstrate example of # math.sinh() method# importing math moduleimport math # number x = -10print("math.sinh(",x,"): ", math.sinh(x))x = 0print("math.sinh(",x,"): ", math.sinh(x))x = 1.5print("math.sinh(",x,"): ", math.sinh(x))x = 5print("math.sinh(",x,"): ", math.sinh(x))x = 15.45print("math.sinh(",x,"): ", math.sinh(x))

Output

输出量

math.sinh( -10 ):  -11013.232874703393math.sinh( 0 ):  0.0math.sinh( 1.5 ):  2.1292794550948173math.sinh( 5 ):  74.20321057778875math.sinh( 15.45 ):  2563419.889913433

TypeError example

TypeError示例

# Python code to demonstrate example of # math.sinh() method with exception# importing math moduleimport math # number x = "2.5"print("math.sinh(",x,"): ", math.sinh(x))

Output

输出量

Traceback (most recent call last):  File "/home/main.py", line 9, in 
print("math.sinh(",x,"): ", math.sinh(x))TypeError: a float is required

翻译自:

sinh

转载地址:http://huxzd.baihongyu.com/

你可能感兴趣的文章
阶段3 2.Spring_02.程序间耦合_1 编写jdbc的工程代码用于分析程序的耦合
查看>>
阶段3 2.Spring_01.Spring框架简介_04.spring发展历程
查看>>
阶段3 2.Spring_02.程序间耦合_3 程序的耦合和解耦的思路分析1
查看>>
阶段3 2.Spring_02.程序间耦合_5 编写工厂类和配置文件
查看>>
阶段3 2.Spring_01.Spring框架简介_05.spring的优势
查看>>
阶段3 2.Spring_02.程序间耦合_7 分析工厂模式中的问题并改造
查看>>
阶段3 2.Spring_02.程序间耦合_4 曾经代码中的问题分析
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_2 spring中的Ioc前期准备
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_4 ApplicationContext的三个实现类
查看>>
阶段3 2.Spring_02.程序间耦合_8 工厂模式解耦的升级版
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_6 spring中bean的细节之三种创建Bean对象的方式
查看>>
阶段3 2.Spring_04.Spring的常用注解_3 用于创建的Component注解
查看>>
阶段3 2.Spring_04.Spring的常用注解_2 常用IOC注解按照作用分类
查看>>
阶段3 2.Spring_09.JdbcTemplate的基本使用_5 JdbcTemplate在spring的ioc中使用
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_02.ssm整合之搭建环境
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_3、快速创建SpringBoot应用之手工创建web应用...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_04.ssm整合之编写SpringMVC框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_5、SpringBoot2.x的依赖默认Maven版本...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_08.ssm整合之Spring整合MyBatis框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_9、SpringBoot基础HTTP其他提交方法请求实战...
查看>>