Equals Number
Tests whether two numbers are equal.
Node id logic/equals-number
The Equals Number node outputs true if a and b are the same number, and
false otherwise.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| a | number | 0 | |
| b | number | 0 |
Outputs
| Name | Type | Notes |
|---|---|---|
| result | boolean |
Behaviour
- Defaults. Both inputs default to 0.
- Exact. Numbers computed in different ways may differ by a tiny amount: 0.1 + 0.2 is 0.30000000000000004, so it doesn't equal 0.3. To compare with a tolerance, test whether the Abs of the difference is Lower than a small number, or Round both first.
- NaN equals nothing, not even NaN: the result is then false. 0 and -0 are equal.
Related nodes
- Not Equals Number: the opposite test.
- Modulo: with Equals Number and 0, tests whether a number is a multiple of another.