博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python变量和常量_Python数学模块常量和示例
阅读量:2531 次
发布时间:2019-05-11

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

python变量和常量

Python数学模块常量 (Python math module constants)

In the math module, there are some of the defined constants that can be used for various mathematical operations, these are the mathematical constants and returns their values equivalent to their standard defined values.

数学模块中,有一些定义的常数可用于各种数学运算,这些是数学常数,它们返回的值等于其标准定义值。

In , there are following math module constants.

在 ,有以下数学模块常量

数学模块/库的常数列表 (List of constants of math module/library )

Sr. Keyword Description
1 It returns the value of mathematics constant PI (π), the value is 3.141592...
2 It returns the value of mathematical constant e, the value is 2.718281...
3 It returns the value of mathematical constant TAU (τ), the value is 6.283185...
4 It returns the floating-point positive infinity, -math.inf is used to get the floating-point negative infinity.
5 It returns the floating-point nan (Not a Number), the value is nan.
高级 关键词 描述
1个 它返回数学常数PI( π )的值,该值为3.141592 ...
2 它返回数学常数e的值,该值为2.718281 ...
3 它返回数学常数TAU( τ )的值,该值为6.283185 ...
4 它返回浮点正无穷大, -math.inf用于获取浮点负无穷大。
5 它返回浮点nan (不是数字),值为nan 。

Python代码演示数学模块常量的示例 (Python code to demonstrate example of math module constants)

In this example, we are printing the value of all constants of python math module.

在此示例中,我们将打印python math模块的所有常量的值。

# python code to demonstrate example of # math module constants# importing math moduleimport math # printing value of PIprint("value of pi = ", math.pi)# printing value of eprint("value of e = ", math.e)# printing value of tauprint("value of tau = ", math.tau)# printing value of infinityprint("value of +ve inf = ", math.inf)print("value of -ve inf = ", -math.inf)# printing value of nanprint("value of nan = ", math.nan)

Output

输出量

value of pi = 3.141592653589793value of e = 2.718281828459045value of tau = 6.283185307179586value of +ve inf = infvalue of -ve inf = -inf value of nan = nan

翻译自:

python变量和常量

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

你可能感兴趣的文章
实验三
查看>>
机器码和字节码
查看>>
环形菜单的实现
查看>>
Python 函数参数 传引用还是传值
查看>>
【解决Chrome浏览器和IE浏览器上传附件兼容的问题 -- Chrome关闭flash后,uploadify插件不可用的解决办法】...
查看>>
34 帧动画
查看>>
二次剩余及欧拉准则
查看>>
Centos 7 Mysql 最大连接数超了问题解决
查看>>
thymeleaf 自定义标签
查看>>
关于WordCount的作业
查看>>
C6748和音频ADC连接时候的TDM以及I2S格式问题
查看>>
UIView的layoutSubviews,initWithFrame,initWithCoder方法
查看>>
STM32+IAP方案 实现网络升级应用固件
查看>>
用74HC165读8个按键状态
查看>>
jpg转bmp(使用libjpeg)
查看>>
linear-gradient常用实现效果
查看>>
sql语言的一大类 DML 数据的操纵语言
查看>>
VMware黑屏解决方法
查看>>
JS中各种跳转解析
查看>>
JAVA 基础 / 第八课:面向对象 / JAVA类的方法与实例方法
查看>>