See Original text in context
method ceiling(Rational: --> Int)
Return the smallest integer not less than the invocant. If denominator is zero, fail with X::Numeric::DivideByZero
.
See Original text in context
method ceiling(Real: --> Int)
Returns the smallest integer not less than the number.
See Original text in context
multi sub ceiling(Numeric(Cool))multi method ceiling
Coerces the invocant (or in sub form, its argument) to Numeric, and rounds it upwards to the nearest integer.
say "1".ceiling; # OUTPUT: «1»say "-0.9".ceiling; # OUTPUT: «0»say "42.1".ceiling; # OUTPUT: «43»
See Original text in context
method ceiling(Complex: --> Complex)
Returns self.re.ceiling + self.im.ceiling
. That is, each of the real and imaginary parts is rounded to the lowest integer not less than the value of that part.
say (1.2-3.8i).ceiling; # OUTPUT: «2-3i»