Skip to content

floor_divide

relationalai.semantics.std.math
floor_divide(numerator: NumberValue, denominator: NumberValue) -> Expression

Perform floor division (the quotient rounded toward negative infinity).

This is the same operation as the // operator. The result follows Python: for operands of opposite sign, floor_divide(-7, 2) is -4 (not -3). Use trunc_divide for division that truncates toward zero.

  • numerator

    (NumberValue) - The numerator.
  • denominator

    (NumberValue) - The denominator.
  • Expression - An Expression computing the floored quotient. Returns Number for Number inputs, or Float for Float inputs.