Python--计算、开方、乘方函数

Autor: LiChong0309
Label: Python

1. 两个函数

1.1 pow()

pow(a,b) :求a^b的数值。当a为整数时,返回整数值,当a为浮点数时,返回一位小数的浮点数。

这里写图片描述

1.2 sqrt()

sqrt()函数不能单独使用,要先调用函数库math或者numpy才能使用。当开方得到是有限数时,返回一位小数的浮点数。

这里写图片描述
这里写图片描述

2. 两个函数库

2.1 numpy

import numpy
numpy.sqrt(64)

这里写图片描述

2.2 math

import math
math.sqrt(36)

这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_38630100/article/details/80780679