Math取整

三種取整 Math.ceil()向上取整 Math.floor()向下取整 Math.round()四捨五入 輸出結果: Math.floor(11.5)= 11.0 Math.floor(-11.5)= -12.0 Math.ceil(11.5)= 12.0 Math.ceil(-11.5)= -11.0 Math.round(11.5)= 12 Math.round(-11.5)= -11
相關文章
相關標籤/搜索