ceiling
ErrorsCollection

ceiling

Synthesised documentation from type/Rational type/Real type/Cool type/Complex

From type/Rational

See Original text in context

method ceiling(Rational:D: --> Int:D)

Return the smallest integer not less than the invocant. If denominator is zero, fail with X::Numeric::DivideByZero.

From type/Real

See Original text in context

method ceiling(Real:D: --> Int:D)

Returns the smallest integer not less than the number.

From type/Cool

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␤»

From type/Complex

See Original text in context

method ceiling(Complex:D: --> Complex:D)

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␤»