Python ceil() 函数
来自菜鸟教程https://www.runoob.com/python/func-number-ceil.html以下是 ceil() 方法的语法:import mathmath.ceil( x )以下展示了使用 ceil() 方法的实例:#!/usr/bin/pythonimport math# This will import math moduleprint "math.ceil(-45.1
·
来自菜鸟教程
https://www.runoob.com/python/func-number-ceil.html
以下是 ceil() 方法的语法:
import math
math.ceil( x )
以下展示了使用 ceil() 方法的实例:
#!/usr/bin/python
import math # This will import math module
print "math.ceil(-45.17) : ", math.ceil(-45.17)
print "math.ceil(100.12) : ", math.ceil(100.12)
print "math.ceil(100.72) : ", math.ceil(100.72)
print "math.ceil(119L) : ", math.ceil(119L)
print "math.ceil(math.pi) : ", math.ceil(math.pi)
以上实例运行后输出结果为:
math.ceil(-45.17) : -45.0
math.ceil(100.12) : 101.0
math.ceil(100.72) : 101.0
math.ceil(119L) : 119.0
math.ceil(math.pi) : 4.0
更多推荐
7日热学榜
活动日历
查看更多
活动时间 2025-01-01 00:00:00

丁奇:MySQL高频面试题详解
活动时间 2025-01-01 00:00:00

AI 大模型应用开发 · 实战营
活动时间 2025-01-01 00:00:00

AI系列课程-IT全学科自学科
活动时间 2025-01-01 00:00:00

3 小时掌握 Prompt 核心技巧与 GPT 技术理论
活动时间 2025-01-01 00:00:00

0基础2个月拿下软考高级证书体验课
所有评论(0)