Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Numeric#ceil
() -> ::Integer
(::Integer digits) -> (::Integer | ::Numeric)
ceil(ndigits = 0) → float or integer
numeric.c
View on GitHub ↗
static VALUE
num_ceil(int argc, VALUE *argv, VALUE num)
{
return flo_ceil(argc, argv, rb_Float(num));
}
Returns the smallest float or integer that is greater than or equal to self, as specified by the given ndigits, which must be an integer-convertible object.
Equivalent to self.to_f.ceil(ndigits).
Related: floor, Float#ceil.