我懷疑老師有個地方是不是寫錯了?
1.ceil是最大返回最大參數的最小整數 2.floor()是返回最大值的最小整數; 可是我查了一下api,上面寫的是這句話 Returns?the?largest?(closest?to?positive?infinity)?double?value? that?is?less?than?or?equal?to?the?argument?and?is?equal?to?a?mathematical? integer.?Special?cases: If?the?argument?value?is?already?equal?to?a?mathematical?integer,?then?the? result?is?the?same?as?the?argument.? 寫的是返回最大的值是的整數
2022-05-07
floor :地板? ?向下取整
ceil:天花板 向上取整
這樣理解是不是好很多
搜索
復制
2017-05-23
理解了floor與ceil兩個單詞的意思就比較好了解這兩個方法了,floor即向下,ceil指天花板,即向上。12.81向下就是12.0,向上就是13.0
2017-05-05
沒有錯啊