Skip to main content

Modulo

This node calculates the remainder after division of two numbers.

The Modulo node performs the modulo operation to find the remainder of division.

The Modulo node calculates the remainder when the first number is divided by the second number. This operation is useful for cyclic calculations, array wrapping, and determining divisibility.

Inputs

Numbers

DataDescription
First NumberThe dividend (default: 0)
Second NumberThe divisor (default: 1)

Actions

SignalDescription
DoTriggers the modulo calculation

Outputs

DataDescription
ResultThe remainder of the division
SignalDescription
DoneTriggered when the calculation is complete

Usage

Example Use Cases

  1. Cyclic Operations: Wrap array indices or create repeating patterns
  2. Even/Odd Detection: Use modulo 2 to determine if numbers are even or odd
  3. Time Calculations: Convert minutes to hours and minutes, seconds to time units
  4. Game Development: Create circular movement patterns or repeating events

Examples

First NumberSecond NumberResult
1031
1543
820
-73-1
25105

Error Handling

  • Division by zero protection (same as Division node)
  • Input validation for valid numbers
  • Range checking for results