python取整函数

BEGIN:

import math

1  向上取整 math.ceil():

如:

 

 

2  向下取整 math.floor() 、int(),其中int()又称为向0取整:

如:

 

又如:

 

3 四舍五入取整 round():

如:

 

 

END.

posted @ 2020-08-07 14:13  Gangpei  阅读(700)  评论(0)    收藏  举报