Python中的数学函数1

2024-11-03 19:25:08

Python中的数学运算需要用到很多函数,下面简单介绍下几种数学函数。

Python中的数学函数1

工具/原料

电脑

python

数学函数:

1、abs():返回数字的绝对值,如abs(-1) 返回 1。

Python中的数学函数1Python中的数学函数1

2、ceil():返回数字的上入整数,如math.ceil(0.1) 返回 1。

Python中的数学函数1Python中的数学函数1

3、lt(a,b):两个变量比较,a<b返回True,否则False。

Python中的数学函数1Python中的数学函数1

4、exp():返回e的x次幂,如math.exp(2) 返回7.38905609893065。

Python中的数学函数1Python中的数学函数1
猜你喜欢