Max
Float
MAX
The MAX node is a utility node that takes two floating-point numbers as input and outputs the larger of the two values. It provides a simple way to compare numbers and select the maximum value within a spell.
Inputs
a
(float, default: 0): The first number to compare.b
(float, default: 0): The second number to compare.
Outputs
result
(float): The maximum value between the two input numbers.
Configuration
This node does not have any configuration options.
Usage
To use the MAX node, follow these steps:
- Add the MAX node to your spell.
- Connect the
a
input to the first number you want to compare. - Connect the
b
input to the second number you want to compare. - The
result
output will provide the maximum value between the two input numbers.
Example
Here’s an example of how to use the MAX node in a spell:
In this example, the MAX node will compare the values 5 and 8, and output the maximum value 8 to the Debug node.
Best Practices
- Use the MAX node when you need to select the larger value between two numbers in your spell logic.
- Connect the
a
andb
inputs to the appropriate number sources in your spell. - Remember that the MAX node only works with floating-point numbers. If you need to compare integers, use the MAX (Integer) node instead.
Common Issues
- Ensure that both
a
andb
inputs are properly connected to number sources. If either input is left unconnected, the MAX node will use the default value of 0. - Be aware that the MAX node does not handle non-numeric inputs. Connecting a non-numeric value (e.g., a string) to either input will result in an error.
By using the MAX node, you can easily compare and select the maximum value between two numbers in your Magick spells, enabling you to build more complex logic and decision-making processes.