Skip to content

Int Math Operation

Performs basic arithmetic on two integers. Supports addition, subtraction, multiplication, integer division, modulo, and exponentiation. Division and modulo by zero are guarded and return 0.
Preview

Usage

Use this node whenever you need integer arithmetic in a workflow, such as initializing counters, accumulating totals, or computing loop indices. Connect integer-producing nodes to inputs a and b, select the desired operation, and route the single integer result to downstream nodes (e.g., conditions, loops, or outputs).

Inputs

FieldRequiredTypeDescriptionExample
aTrueINTFirst integer operand. Accepts any 64-bit range integer.5
bTrueINTSecond integer operand. Accepts any 64-bit range integer.3
operationTrueSTRING (choice: add, subtract, multiply, divide, modulo, power)Specifies which arithmetic operation to perform on a and b. divide uses integer division (floor).multiply

Outputs

FieldTypeDescriptionExample
resultINTThe integer result of the selected operation.15

Important Notes

  • Division behavior: The divide operation performs integer division (a // b). For negative values, this is floor division.
  • Zero handling: If b is 0 for divide or modulo, the node returns 0.
  • Large numbers: power can produce very large integers; ensure downstream nodes can handle big values.
  • Type expectations: Inputs must be integers; provide conversions upstream if starting from strings or floats.

Troubleshooting

  • Result is 0 unexpectedly: Check if b is 0 for divide or modulo; the node returns 0 in these cases.
  • Non-integer inputs rejected: Ensure upstream nodes output INT. Add conversion steps if necessary.
  • Unexpected division result with negatives: Remember integer division floors toward negative infinity (e.g., -3 // 2 = -2).
  • Performance issues on power: Very large exponents can be slow or produce huge numbers; constrain inputs or switch to float operations if appropriate.