%

This block is part of the math group and was last modified in core v10.4.28.

% v10.4.28

Returns the remainder left over when one operand is divided by a second operand.

In pins 2
  • number_0 required
    number
  • number_1 required
    number
Out pins 1
  • Number
    number

Outputs the JS-style remainder of number_0 divided by number_1; the result takes the dividend's sign. Either pin unwired or nil outputs nil; a wired non-numeric value counts as 0, so an invalid or zero divisor yields NaN. Example: number_0=-7 number_1=3 -> -1.

mod
remainder
modulo

A typical wiring for %: the number out pin feeds cast to value.

Studio canvas example for the % block: typical wiring for %.

Version history

Introduced in v10.4.28.


Back to math Return to the main group to view all sub-groups Back to number: operators Return to the group to view all blocks within this group