Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

math.fmod (procNode)

The remainder of a divided by b that keeps the sign of a, element by element: -7 divided by 3 leaves -1. A b of 0 answers 0.

The fmod operation of the authoring surface, called through the Luau node on proc.fieldc.operators. Operands are numbers, vectors, Columns or Fields. When every operand is a plain number or vector the answer is the plain result, folded where the node cooks; otherwise the answer is a Field: a template over its operands that whatever reads it evaluates in one dispatch together with the chain around it. Nothing dispatches for this node alone. Over numbers and animated values the answer is an animated value: the operation at every time.

math.mod keeps the sign of b, so a repeating pattern wraps the same way on both sides of zero; fmod keeps the sign of a.

Inputs

  • a (Value, default 0). The value divided.
  • b (Value, default 0). The divisor.

Outputs

  • value. The remainder, with the sign of a.
local value = g.math.fmod({ a = -7, b = 3 }) -- -1