268
306
1261
管理员
在天龙中math.floor被封装为floor()函数
lua 中的math.floor函数是向下取整函数。
math.floor(5.123) – 5
math.floor(5.523) – 5
用此特性实现四舍五入
math.floor(5.123 + 0.5) – 5
math.floor(5.523 + 0.5) – 6
也就是对math.floor函数的参数进行 “+ 0.5” 计算
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|Waylee黑技术 ( 浙ICP备15015590号-1 )
GMT+8, 2021-3-6 07:09 , Processed in 0.093725 second(s), 26 queries .
Powered by Discuz! X3.4 Licensed
Copyright © 2001-2020, Tencent Cloud.