Math Less Than (Float)
The Math Less Than (Float) node compares two floating-point numbers and outputs a boolean value indicating whether the first input is less than the second.Inputs
a(float, default: 0): The first number to compare.b(float, default: 0): The second number to compare.
Outputs
result(boolean): True ifais less thanb, false otherwise.
Configuration
This node has no additional configuration options.Usage
To use the Math Less Than (Float) node:- Add the node to your spell.
- Connect the
ainput to the first floating-point number you want to compare. - Connect the
binput to the second floating-point number you want to compare. - The
resultoutput will emit a boolean value indicating whetherais less thanb.
Example
Suppose you have a spell that needs to check if a user’s age is less than 18. You can use the Math Less Than (Float) node to perform this comparison:result output will be true, and the spell can take appropriate action based on the Decision Node’s configuration.
Best Practices
- Ensure that both inputs are valid floating-point numbers to avoid unexpected behavior.
- Remember that the comparison is strictly “less than”. If you need to check for “less than or equal to”, consider using a combination of the Math Less Than (Float) and Math Equal (Float) nodes.
Common Issues
- If either input is not a valid floating-point number, the node may produce unexpected results or errors. Always ensure that the inputs are of the correct type.
- Be cautious when comparing floating-point numbers for equality, as rounding errors may cause slight differences in values. Consider using a small tolerance value when checking for equality.
