routine ceiling
| 1 | class Complex |
| 1.1 | (Complex) method ceiling |
| 2 | role Real |
| 2.1 | (Real) method ceiling |
| 3 | role Rational |
| 3.1 | (Rational) method ceiling |
| 4 | class Cool |
| 4.1 | (Cool) routine ceiling |
Documentation for routine ceiling assembled from the following types:
class Complex
From Complex
(Complex) method ceiling
Defined as:
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»
role Real
From Real
(Real) method ceiling
method ceiling(Real --> Int)
Returns the smallest integer not less than the number.
role Rational
From Rational
(Rational) method ceiling
Defined as:
method ceiling(Rational: --> Int)
Return the smallest integer not less than the invocant. If denominator is zero, fails with X::Numeric::DivideByZero.
class Cool
From Cool
(Cool) routine ceiling
Defined as:
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»