Subtract
Integer
Math Subtract Integer
The Math Subtract Integer node performs subtraction on two input integers and outputs the result.
Inputs
a
(integer): The first input integer. Default value is 0.b
(integer): The second input integer to subtract froma
. Default value is 0.
Outputs
result
(integer): The result of subtractingb
froma
.
Configuration
This node has no additional configuration options.
Usage
To use the Math Subtract Integer node:
- Add the Math Subtract Integer node to your spell.
- Connect integer values to the
a
andb
input ports. If no values are provided, the default values of 0 will be used. - The node will output the result of
a - b
on theresult
output port. - Connect the
result
output to the input of another node or use it as the final output of your spell.
Example
Here’s an example of how to use the Math Subtract Integer node in a spell:
Best Practices
- Ensure that the values connected to the
a
andb
inputs are of type integer. Connecting other data types may cause unexpected behavior. - Remember that the order of subtraction matters. The node subtracts
b
froma
, not the other way around.
Common Issues
- If the result of the subtraction is outside the range of valid integer values, the output may be unexpected or cause an error. Be mindful of potential integer overflow when working with large values.