python中的exp是什么

2025-12-02 0 39,583

Python exp() 函数

描述

exp() 函数返回 x 的指数,b4602d783b80651d51ec9d5d7ca7906.png

语法

import math
math.exp(x)

注意:exp() 是不能直接访问的,需导入 math 模块,通过静态对象调用该方法。

参数

x — 数值表达式。

返回值

返回 x 的指数,b4602d783b80651d51ec9d5d7ca7906.png

实例

# -*- 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.38905609893
math.exp(100.12) :  3.03084361407e+43
math.exp(100.72) :  5.52255713025e+43
math.exp(119L) :  4.7978133273e+51
math.exp(math.pi) :  23.1406926328

python学习网,大量的免费python视频教程,欢迎在线学习!

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:以上部本文内容由互联网用户自发贡献,本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。投诉邮箱:3758217903@qq.com

ZhiUp资源网 常见问题 python中的exp是什么 https://www.zhiup.top/8077.html

相关