Ceil
Ceil() 會將 x 向上捨入至最近的 step [+ offset] 的倍數。 offset 的預設值為 0。
相較於向下捨入輸入數字的
Syntax:
Ceil(x[, step[, offset]])
Return data type: 整數
Examples and results:
範例 | 結果 |
---|---|
Ceil( 2.4 ) |
傳回 3 |
Ceil( 2.6 ) |
傳回 3 |
Ceil( 3.88 , 0.1 ) |
傳回 3.9 |
Ceil( 3.88 , 5 ) |
傳回 5 |
Ceil( 1.1 , 1 ) |
傳回 2 |
Ceil( 1.1 , 1 , 0.5 ) |
傳回 1.5 |
Ceil( 1.1 , 1 , -0.01 ) |
傳回 1.99 |