tinymist_std::typst::foundations::calc

Function quo

pub fn quo(
    span: Span,
    dividend: DecNum,
    divisor: Spanned<DecNum>,
) -> Result<i64, EcoVec<SourceDiagnostic>>
Expand description

Calculates the quotient (floored division) of two numbers.

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.

$ "quo"(a, b) &= floor(a/b) \
  "quo"(14, 5) &= #calc.quo(14, 5) \
  "quo"(3.46, 0.5) &= #calc.quo(3.46, 0.5) $