带有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**x.
math.exp()方法是math模块的库方法,用于获取指数形式的数字,它接受一个数字并以指数格式返回该数字(如果数字为x ,则返回e ** x 。
Note: If anything is passed except the number, the method returns a type error, "TypeError: a float is required".
注意:如果传递了除数字以外的任何内容,则该方法将返回类型错误“ TypeError:需要浮点数”。
Syntax of math.exp() method:
math.exp()方法的语法:
math.exp(n)
Parameter(s): n – an integer or a float number.
参数: n-整数或浮点数。
Return value: float – it returns a float value that is an exponential form of the number n.
返回值: float –它返回一个浮点数,该浮点数是数字n的指数形式。
Example:
例:
Input:
a = 111.111
# function call
print(math.exp(a))
Output:
1.7984326512709283e+48
Python代码演示math.exp()方法的示例 (Python code to demonstrate example of math.exp() method)
# Python code demonstrate example of
# math.exp() method
import math
# numbers
a = 0
b = 245
c = -102.34
d = 111.111
e = -123.456
# printing values in exp format
print("exp(a): ", math.exp(a))
print("exp(b): ", math.exp(b))
print("exp(c): ", math.exp(c))
print("exp(d): ", math.exp(d))
print("exp(e): ", math.exp(e))
Output
输出量
exp(a): 1.0
exp(b): 2.5243412626998188e+106
exp(c): 3.583461328080821e-45
exp(d): 1.7984326512709283e+48
exp(e): 2.4195825412645934e-54
翻译自: https://www.includehelp.com/python/math-exp-method-with-example.aspx
带有Python示例的math.exp()方法相关推荐
- python中 math.isfinite返回值为false_带有Python示例的math.isfinite()方法
Python math.isfinite() 方法 math.isfinite()方法是数学模块的一种库方法,用于检查给定数字是否为非有限数,它接受数字(整数/浮点数,有限,无限或NaN),如果数字既 ...
- python中math.ceil是什么意思_带有Python示例的math.ceil()方法
Python math.ceil() 方法 math.ceil()方法是数学模块的库方法,用于获取给定数字的ceil值,它接受数字/数字表达式并返回大于该数字的最小整数值. 注意:如果数字是整数值,则 ...
- math求旋转角度 python_带有Python示例的math.degrees()方法
Python math.degrees() 方法 math.degrees()方法是数学模块的一种库方法,用于将角度值从弧度转换为度,它接受一个数字并返回以度为单位的角度值. 注意: math.deg ...
- python教程cos_带有Python示例的math.cos()方法
Python math.cos() 方法 math.cos()方法是数学模块的库方法,用于获取弧度数的余弦值,它接受一个数字,返回给定弧度的余弦值. 注意: math.cos()方法接受的唯一的号码, ...
- python math.sinh_带有Python示例的math.sinh()方法
Python math.sinh() 方法 math.sinh()方法是数学模块的一种库方法,用于获取以弧度为单位的给定数字的双曲正弦值,它接受一个数字并返回双曲正弦值. 注意: math.sinh( ...
- math.trunc_带有Python示例的math.trunc()方法
math.trunc Python math.trunc()方法 (Python math.trunc() method) math.trunc() method is a library metho ...
- np.isfinite_带有Python示例的math.isfinite()方法
np.isfinite Python math.isfinite()方法 (Python math.isfinite() method) math.isfinite() method is a lib ...
- factorial函数_带有Python示例的math.factorial()方法
factorial函数 Python math.factorial()方法 (Python math.factorial() method) math.factorial() method is a ...
- np.copysign_带有Python示例的math.copysign()方法
np.copysign Python math.copysign()方法 (Python math.copysign() method) math.copysign() method is a lib ...
最新文章
- myeclipse-pro-2014-GA-offline-installer-windows 安装步骤 与安装效果预览
- [deviceone开发]-Star分享的优惠券商户管理端App开源
- java.net.ConnectException: Connection refused: connect
- (50)VHDL实现增减计数器
- 小白用python处理excel文件-刚入门的小白用Python操作excel表格!使工作效率提升一倍不止!...
- 怎样成为PHP 方向的一个合格的架构师(转)
- 多行文字或者单行文字的垂直居中解决方案
- k8s集群部署八(DNS服务发现)
- [译] 移动应用设计新趋势
- Zabbix5系列-监控惠普服务器iLO管理口 (六)
- 细粒度粗粒度_粗粒度基准
- Http gzip 处理
- 论文笔记:SAIN: Self-Attentive Integration Network for Recommendation(SIGIR 2019)
- win7去除快捷方式箭头
- 身在国外,除了克服语言障碍,还得背好99乘法表
- 《路由器开发 - 路由器刷机指南》华硕路由器RT-N66W刷机
- 抖音原创视频如何制作?鹰迪电子商务
- 微信小程序原生实现日历功能
- jquery 处理页面的事件详解
- 如何使用PS的蒙版,调整局部的对比度
热门文章
- Linux原始网络编程,Linux操作系统网络编程 原始套接字 (1)
- php 修改文件访问时间,PHP中获取文件创建日期、修改日期、访问时间的方法
- 传统蒙文字体_蒙古要改回使用传统回鹘蒙文,这是种什么文字,蒙古为什么要改回...
- 利用pyinstaller打包python3程序
- Flutter下拉刷新,上拉加载更多数据
- C艹 指针和const的关系和注意事项(非常有意思)
- 服务器搭建-Linux基础知识
- [转]“Ceph浅析”系列之(—)—Ceph概况
- reactnative 获取定位_[RN] React Native 获取地理位置
- system函数_自学C++基础教程【函数】