我懷疑老師有個(gè)地方是不是寫錯(cuò)了?
1.ceil是最大返回最大參數(shù)的最小整數(shù) 2.floor()是返回最大值的最小整數(shù); 可是我查了一下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.? 寫的是返回最大的值是的整數(shù)
2022-05-07
floor :地板? ?向下取整
ceil:天花板 向上取整
這樣理解是不是好很多
搜索
復(fù)制
2017-05-23
理解了floor與ceil兩個(gè)單詞的意思就比較好了解這兩個(gè)方法了,floor即向下,ceil指天花板,即向上。12.81向下就是12.0,向上就是13.0
2017-05-05
沒有錯(cuò)啊