Ruby 2.3.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Numericクラス > ceil

instance method Numeric#ceil

ceil -> Integer[permalink][rdoc]

自身と等しいかより大きな整数のうち最小のものを返します。



1.ceil        #=> 1
1.2.ceil      #=> 2
(-1.2).ceil   #=> -1
(-1.5).ceil   #=> -1

[SEE_ALSO] Numeric#floor, Numeric#round, Numeric#truncate