在Lua中,math.floor函数是用来向下取整的,返回不大于给定参数的最大整数。

对于math.floor(70/32),首先进行除法运算,结果为2.1875。然后应用math.floor函数,结果为2。

对于math.ceil(math.floor(70/32)),先执行内部的math.floor(70/32),得到2。然后对结果应用math.ceil函数,结果仍为2。

因此,math.floor(70/32)得到2,math.ceil(math.floor(70/32))也得到2。

lua里面的mathfloor函数解析mathfloor7032得到多少mathceilmathfloor7032得到多少

原文地址: https://www.cveoy.top/t/topic/hMLZ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录