> 函数列表
返回 number 四舍五入后的值。 向下取整可以用 floor,向上取整可以用 ceil。
在 Python 中,round() 是语言内置的函数,采用的是银行家舍入:正好在中间时,它向偶数舍入。因此 round(2.5) 为 2,round(0.5) 为 0,而 LeekScript 和 JavaScript 给出的是 3 和 1;round(3.5) 则确实是 4。要还原 LeekScript 的取整方式,请写 math.floor(x + 0.5)。第二个参数用于指定小数位数,这是 LeekScript 的 round 所没有的:round(2.675, 2) 为 2.67。
round(1) // 1 round(1.8) // 2 round(2.3) // 2 round(3.5) // 4 round(-12.79) // -13
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.