tinymist_std::typst::foundations::calc

Function ceil

pub fn ceil(value: DecNum) -> Result<i64, EcoString>
Expand description

Rounds a number up to the nearest integer.

If the number is already an integer, it is returned unchanged.

Note that this function will always return an integer, and will error if the resulting [float] or [decimal] is larger than the maximum 64-bit signed integer or smaller than the minimum for that type.

#calc.ceil(500.1)
#assert(calc.ceil(3) == 3)
#assert(calc.ceil(3.14) == 4)
#assert(calc.ceil(decimal("-3.14")) == -3)