EasyUse/Logic/Mathgenerated

Math Int(mathIntOperation)

The Math Int node performs an integer arithmetic operation between two integer inputs, a and b, and returns the result as an INT.

math Int Operation

INT
a
0
b
0
operation
COMBO
Easy Use

The Math Int node performs an integer arithmetic operation between two integer inputs, a and b, and returns the result as an INT. It is grouped under EasyUse/Logic/Math.

Inputs

  • a (INT, required): The first operand.
    Default: 0
    Min: -18446744073709552000
    Max: 18446744073709552000
    Step: 1

  • b (INT, required): The second operand.
    Default: 0
    Min: -18446744073709552000
    Max: 18446744073709552000
    Step: 1

  • operation (COMBO, required): The arithmetic operation to apply. Available options:

    • add — Returns a + b
    • subtract — Returns a - b
    • multiply — Returns a * b
    • divide — Returns a / b using integer semantics
    • modulo — Returns the remainder of a / b
    • power — Returns a raised to the power of b

Outputs

  • INT: The result of the selected operation. The output is an integer value.

Usage Notes

  • Both inputs and the output are integer-typed, so this node is useful for exact integer math in ComfyUI workflows where floating-point precision is not needed.
  • The divide operation returns an integer result; any fractional part is not preserved. Similarly, power with a negative exponent can produce a non-integer result that will be reduced to an integer because the output type is INT.
  • Be careful with b = 0 for divide and modulo, and with a = 0 combined with a negative exponent in power, since these operations are mathematically undefined or can cause errors.
  • The node can be chained with other Math Int nodes by connecting the INT output to the a or b input of another instance.

Comments

Sign in with GitHub to join the discussion.

Loading comments…