跳到主要内容

浮点数舍入模式

信息

以下是floatround函数可使用的浮点数舍入模式列表。

模式描述
floatround_round四舍五入到最接近的整数。当小数部分正好为 0.5 时向上舍入(默认模式)
floatround_floor向下取整
floatround_ceil向上取整
floatround_tozero正数向下取整,负数向上取整("向零取整")
floatround_unbiased与 floatround_round 功能相同