Skip to content

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

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.

See also #arg #clone #angle #coerce also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0