Float
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 ifa
is 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
a
input to the first floating-point number you want to compare. - Connect the
b
input to the second floating-point number you want to compare. - The
result
output will emit a boolean value indicating whethera
is 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:
In this example, if the user’s age is less than 18, the 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.
By using the Math Less Than (Float) node, you can easily compare two floating-point numbers and make decisions based on the result, enabling you to create more dynamic and responsive spells in Magick.