python中acosh_带有Python示例的math.acosh()方法

python中acosh

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

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

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

Note: math.acosh() method accepts only numbers (positive integer or float greater than or equal to 1), if we provide a negative value it returns a ValueError"ValueError: math domain error", and if we provide anything else except the number, it returns error TypeError"TypeError: a float is required".

注意: math.acosh()方法仅接受数字(正整数或浮点数大于或等于1),如果我们提供负值,它将返回ValueError“ ValueError:math domain error” ,并且如果我们提供其他内容,则除外数字,它返回错误TypeError“ TypeError:需要浮点数”

Syntax of math.acosh() method:

math.acosh()方法的语法:

    math.acosh(x)

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

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

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

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

Example:

例:

    Input:
x = 1.5
# function call
print(math.acosh(x))
Output:
0.9624236501192069

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

# Python code to demonstrate example of 
# math.acosh() method
# importing math module
import math 
# number 
x = 1
print("math.acosh(",x,"): ", math.acosh(x))
x = 1.5
print("math.acosh(",x,"): ", math.acosh(x))
x = 5
print("math.acosh(",x,"): ", math.acosh(x))
x = 15.45
print("math.acosh(",x,"): ", math.acosh(x))

Output

输出量

math.acosh( 1 ):  0.0
math.acosh( 1.5 ):  0.9624236501192069
math.acosh( 5 ):  2.2924316695611777
math.acosh( 15.45 ):  3.429707205929454

ValueError example

ValueError示例

# Python code to demonstrate example of 
# math.acosh() method with exception
# importing math module
import math 
# number 
x = -1
print("math.acosh(",x,"): ", math.acosh(x))

Output

输出量

Traceback (most recent call last):
File "/home/main.py", line 9, in <module>
print("math.acosh(",x,"): ", math.acosh(x))
ValueError: math domain error

TypeError example

TypeError示例

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

Output

输出量

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

翻译自: https://www.includehelp.com/python/math-acosh-method-with-example.aspx

python中acosh

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/546300.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

干货!操作系统基础知识汇总!转给要面试的同学吧

作者&#xff1a;Guide哥来源&#xff1a;公众号 JavaGuide很多读者抱怨计算操作系统的知识点比较繁杂&#xff0c;自己也没有多少耐心去看&#xff0c;但是面试的时候又经常会遇到。所以&#xff0c;我带着我整理好的操作系统的常见问题来啦&#xff01;这篇文章总结了一些我觉…

eclipse的tomcat运行mave web项目

2019独角兽企业重金招聘Python工程师标准>>> 在eclipse中配置maven 安装成功后&#xff0c;就会多出Maven选项&#xff0c;在Installations中添加下载的Maven 在User Settings中配置本机的默认仓库 使用Eclipse的maven构建一个web项目 1、选择建立Maven Project 选…

Python在shell终端中显示进度条

Python在shell终端中显示进度条简单代码&#xff1a; from time import sleep from tqdm import tqdmmax 100 for i in tqdm(range(max)):sleep(0.1)效果如下&#xff1a;

tanh python_带有Python示例的math.tanh()方法

tanh pythonPython math.tanh()方法 (Python math.tanh() method) math.tanh() method is a library method of math module, it is used to get the hyperbolic tangent of given number in radians, it accepts a number and returns hyperbolic tangent. math.tanh()方法是数…

没用过这些IDEA插件?怪不得写代码头疼

小伙伴们&#xff0c;大家好。今天准备和大家一起分享一下实际工作中常用的几款能提升幸福感和工作效率的IDEA插件吧&#xff0c;也欢迎小伙伴们在评论区安利出你们用过的觉得非常不错的插件&#xff0c;大家一起交流进步。1、Background Image Plus默认IDEA的背景一般都比较单…

颠覆与重构——戴尔助力徐工集团等行业客户实现业务转型

无论在IT领域&#xff0c;还是传统行业&#xff0c;颠覆与重构都是不可回避的话题。利用ICT领域的技术创新与互联网思维&#xff0c;传统企业可以更好地实现业务转型与创新。阿里集团与上汽共研互联网汽车&#xff0c;东软致力于推动远程医疗新模式&#xff0c;Mock颠覆传统学习…

Linux多命令顺序执行与管道符

1.多命令顺序执行 实例测试&#xff1a; 2.管道符 实例测试&#xff1a; 3.grep命令 实例测试&#xff1a; 获取更多技术干货&#xff0c;请访问大土土随笔 如果本文对您有所帮助&#xff0c;请关注微信公众号“捷创源科技”。

math.atan_Python中带有示例的math.atan()方法

math.atanPython math.atan()方法 (Python math.atan() method) math.atan() method is a library method of math module, it is used to get the arc tangent, it accepts a number and returns the arc tangent value (in radians) of the given number. math.atan()方法是数…

99%的程序员都在用Lombok,原理竟然这么简单?我也手撸了一个!|建议收藏

世界上只有一种英雄主义&#xff0c;就是看清生活的真相之后依然热爱生活。 对于 Lombok 我相信大部分人都不陌生&#xff0c;但对于它的实现原理以及缺点却鲜为人知&#xff0c;而本文将会从 Lombok 的原理出发&#xff0c;手撸一个简易版的 Lombok&#xff0c;让你理解这个热…

EasyUI DataGrid 中字段 formatter 格式化不起作用

今天用 EasyUI datagrid 来做列表&#xff0c;要对一些数据进行格式化&#xff0c;推断某字段状态时&#xff0c;发现 formatter 格式化相应的函数不起作用。 <table id"list_data" title"未审核报表" class"easyui-datagrid" style"wid…

PyQt5单击QTableView垂直表头verticalHeader获取行数据以及单击单元格获取行数据操作

PyQt5单击QTableView单元格获取单元格数据,很容易实现,从而可以实现获取这一行的数据。但是单击QTableView垂直表头verticalHeader获取行数据,我摸索了一周时间才解决,下面分享下重点。 1.利用PyCharm及Python语言创建PyQt5主界面 添加tableView控件,编程初始化如下: …

python中acosh_acosh()函数以及C ++中的示例

python中acoshC acosh()函数 (C acosh() function) acosh() function is a library function of cmath header, it is used to find nonnegative area hyperbolic cosine of the given value, it accepts a number (x) and returns the nonnegative area hyperbolic cosine of…

震惊!这样终止线程,竟然会导致服务宕机?

在开始之前&#xff0c;我们先来看以下代码会有什么问题&#xff1f; public class ThreadStopExample {public static void main(String[] args) throws InterruptedException {Thread t1 new Thread(() -> {try {System.out.println("子线程开始执行");// 模拟…

华为交换机系统软件升级和安全漏洞修复教程

华为交换机官网 可以查询到华为交换机官方电话:400-822-9999,通过下面2个命令查询出需要升级的交换机软件版本和补丁版本号发给华为,获取新的升级系统软件和补丁以及升级教程。下面是我升级华为交换机总结的教程,作为参考 <HUAWEI> display version<HUAWEI&g…

python里x.pow2_带有Python示例的math.pow()方法

python里x.pow2Python math.pow()方法 (Python math.pow() method) math.pow() method is a library method of math module, it is used to calculate the given power of a base, it accepts two numbers and returns the first number to the power of the second number in…

想读Spring源码?先从这篇「 极简教程」开始

这是我的第 47 篇原创文章。为什么要阅读源码&#xff1f;这是一个有趣的问题&#xff0c;类似的问题还有&#xff0c;为什么要看书&#xff1f;为什么要爬山&#xff1f;这也是一个哲学问题&#xff0c;我想每个人都有不同的答案&#xff0c;下面我是对阅读源码好处的一些思考…

Linux Shell接收键盘输入

1.read命令格式 read [选项] [变量名] 选项&#xff1a; -p “提示信息”&#xff1a;在等待read输入时&#xff0c;输出提示信息 -t “秒数”&#xff1a; read命令会一致等待用户输入&#xff0c;使用此选项可以指定等待时间 -n “字符数”&#xff1a; read命令只接受指…

机房收费重构之总结篇

《机房收费重构》之路终于接近了尾声&#xff0c;这么一个月的时间做梦都在敲代码。总结《机房收费重构》的道路需要从学习方法&#xff0c;注意问题&#xff0c;知识总结三方面来进行&#xff01; 《机房收费重构》之路的背景&#xff1a; 1.设计模式&#xff1a; 设计模式的思…

带有Python示例的math.exp()方法

Python math.exp()方法 (Python math.exp() method) math.exp() method is a library method of math module, it is used to get the number in exponential form, it accepts a number and returns the number in the exponential format (if the number is x, it returns e*…

想快速拥有个人网站?来试试这个...

一、简介Hugo 是Go语言实现的一款静态网站生成器。它简单、易用、高效、易扩展、快速部署。相比较其他静态网站生成器&#xff0c;它的优点有这几点&#xff1a;项目构建特别快主题目录与站点目录结构一样配置文件为*.toml 格式&#xff0c;语法常简单易懂&#xff0c;没有缩进…