Python学习笔记:向上取整

#向上取整-方法1 import math while 1==1:     num=math.ceil(round(float(input('请输入一个小数:')),2))     print(num) #向上取整-方法2 import math while 1==1: #round对浮点数近似取值,各python版本、浮点数的精度有影响,对浮点数精度有要求的不要用round     num=ro
相关文章
相关标签/搜索