Skip to content

Int Math Operation

Performs a mathematical operation on two integers and returns a single integer. Supports addition, subtraction, multiplication, integer division, modulo, and exponentiation. Division and modulo by zero are safely handled by returning 0.
Preview

Usage

Use this node when you need integer arithmetic in a workflow, such as counters, loop indices, pagination, or discrete transformations. Select the operation and provide integer inputs a and b. Note that divide performs integer (floor) division.

Inputs

FieldRequiredTypeDescriptionExample
aTrueINTFirst integer operand.10
bTrueINTSecond integer operand.3
operationTrueCHOICEMathematical operation to apply to a and b.divide

Outputs

FieldTypeDescriptionExample
resultINTThe computed integer after applying the selected operation to a and b.3

Important Notes

  • Division uses integer division (floor), e.g., 10 / 3 returns 3.
  • If b is 0 for divide or modulo, the node returns 0.
  • Power can produce very large integers; be mindful of input sizes.
  • On unknown operations or internal errors, the node returns 0.
  • Inputs support very large negative and positive integers.

Troubleshooting

  • Result is 0 unexpectedly: Ensure b is not 0 for divide/modulo and that a valid operation is selected.
  • Unexpected rounding in divide: Integer division truncates toward negative infinity; use a float math node if fractional results are needed.
  • Extremely large results or slow execution: Limit input sizes for power operations.
  • Output not updating: Verify that a, b, and operation are correctly set or connected.