向下取整
例如
>> floor(3.8)
ans = 3
help floor
FLOOR Round towards minus infinity.
FLOOR(X) rounds the elements of X to the nearest integers
towards minus infinity.
See also round, ceil, fix.
Overloaded methods:
codistributed/floor
擴展資料:
floor函數,其功能是“向下取整”,或者說“向下舍入”、“向零取舍”,即取不大於x的最大整數,與“四舍五入”不同,下取整是直接取按照數軸上最接近要求值的左邊值,即不大於要求值的最大的那個整數值。
語法:
FLOOR(number, significance)
Number必需,要舍入的數值。
Significance必需,要舍入到的倍數。
將 number 向下舍入(向零的方向)到最接近的 significance 的倍數。
百度百科-floor函數
百度百科-MATLAB