Python exp() 函数
描述
exp() 函数返回 x 的指数,
语法
import mathmath.exp(x)
注意:exp() 是不能直接访问的,需导入 math 模块,通过静态对象调用该方法。
参数
立即学习“Python免费学习笔记(深入)”;
x 数值表达式
返回值
返回 x 的指数
实例
# -*- coding: UTF-8 -*-import math # 导入 math 模块print "math.exp(2) : ", math.exp(2)print "math.exp(100.12) : ", math.exp(100.12)print "math.exp(100.72) : ", math.exp(100.72)print "math.exp(119L) : ", math.exp(119L)print "math.exp(math.pi) : ", math.exp(math.pi)
输出:
math.exp(2) : 7.38905609893math.exp(100.12) : 3.03084361407e+43math.exp(100.72) : 5.52255713025e+43math.exp(119L) : 4.7978133273e+51math.exp(math.pi) : 23.1406926328
描述
exp() 函数返回 x 的指数,
语法
import mathmath.exp(x)
注意:exp() 是不能直接访问的,需导入 math 模块,通过静态对象调用该方法。
参数
立即学习“Python免费学习笔记(深入)”;
x 数值表达式
返回值
返回 x 的指数
实例
# -*- coding: UTF-8 -*-import math # 导入 math 模块print "math.exp(2) : ", math.exp(2)print "math.exp(100.12) : ", math.exp(100.12)print "math.exp(100.72) : ", math.exp(100.72)print "math.exp(119L) : ", math.exp(119L)print "math.exp(math.pi) : ", math.exp(math.pi)
输出:
math.exp(2) : 7.38905609893math.exp(100.12) : 3.03084361407e+43math.exp(100.72) : 5.52255713025e+43math.exp(119L) : 4.7978133273e+51math.exp(math.pi) : 23.1406926328
【相关推荐】
1. 分享Python中用于计算指数的exp()方法实例教程
以上就是详解Python中exp() 函数教程的详细内容,更多请关注php中文网其它相关文章!
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号