SIGN
The SIGN node is a utility node that determines the sign of an integer input. It outputs an integer value indicating whether the input is positive, negative, or zero.Inputs
a(integer, default: 0): The input integer value to determine the sign of.
Outputs
result(integer): An integer value representing the sign of the input:- 1 if the input is positive
- -1 if the input is negative
- 0 if the input is zero
Configuration
This node has no configuration options.Usage
To use the SIGN node, simply connect an integer value to itsa input. The node will output an integer indicating the sign of the input value.
This node is useful in situations where you need to make decisions or perform different actions based on whether a value is positive, negative, or zero. For example, you might use the SIGN node to control the direction of movement in a game or simulation, or to determine which branch of a conditional flow to take.
Example
Here’s a simple example spell that uses the SIGN node to determine the sign of a random integer and display a corresponding message:Best Practices
- Make sure to connect an integer value to the
ainput of the SIGN node. Connecting other data types may lead to unexpected behavior. - Use the SIGN node in combination with other nodes, such as Switch or Condition nodes, to make decisions based on the sign of a value.
