Subtract
Float
Math Subtract Float
The Math Subtract Float node performs subtraction on two floating-point numbers. It takes two input values, subtracts the second value from the first, and outputs the result.
Inputs
a
(float, default: 0): The first value in the subtraction operation.b
(float, default: 0): The second value in the subtraction operation, which will be subtracted froma
.
Outputs
result
(float): The result of subtractingb
froma
.
Configuration
This node has no additional configuration options.
Usage
To use the Math Subtract Float node:
- Add the Math Subtract Float node to your spell.
- Connect the
a
input to the first value you want to subtract from. - Connect the
b
input to the value you want to subtract. - The
result
output will contain the result of the subtraction operation.
Example
Here’s an example of how to use the Math Subtract Float node in a spell:
The Debug Log will output the result of 10.5 - 3.7, which is 6.8.
Best Practices
- Ensure that the input values are valid floating-point numbers. Non-numeric inputs may cause unexpected behavior.
- Remember that the order of inputs matters:
a
is the value being subtracted from, andb
is the value being subtracted.
Common Issues
- If either input is not a valid floating-point number, the node may output
NaN
(Not a Number) or an unexpected result. - Be cautious when subtracting very large or very small numbers, as floating-point precision limitations may affect the accuracy of the result.