2017-04-02 70 views

回答

-1

Math.Floor向下舍入Math.Ceiling向上舍入和Math.Truncate轮朝零。因此,Math.Truncate就像Math.Floor用于正数,而Math.Ceiling用于负数。

+0

从不同的答案复制没有参考是不好的风格 – NineBerry

0

对于负数,这些函数的行为不同。

Math.Truncate(-4.5) = -4

Math.Floor(-4.5) = -5

相关问题