2017-04-02 77 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

相關問題