≈ (LogiX node)

From Neos Wiki
Jump to navigation Jump to search
Other languages:
English • ‎日本語 • ‎한국어
'≈' LogiX node
Inputs
  Float A
  Float B
  Float Epsilon
Outputs
  Bool *

The node checks whether inputs A and B are approximately equal. If they are within the margin of error specified by the Epsilon input this node outputs True, otherwise False.

Usage

Due to the fact that decimal numbers often cannot be precisely encoded in binary it is unreliable to use the == (LogiX node) to attempt to test whether two floating point numbers are exactly equal. This node can be used in this situation to check whether two floating point numbers are approximately equal. Note that the output can sometimes be counterintuitive, again due to the inability to precisely encode decimal numbers in binary. For example, 0 and 0.5 are reported as not equal with an Epsilon of 0.5. However 0.4 and 0.9, where the difference is again 0.5, are reported as equal with the same Epsilon value.

This node can be overloaded to accept vector inputs at A and B (e.g. float 3). In that case equality comparisons are performed element-wise using the same Epsilon value for each.

Other nodes which can often be used in place of this node are or .

Examples

Node Menu

Operators
Back Bool Vectors Nullable Parsing - ! !=
% & ?: ?? ^ | |V|
|V|² + +/- +1 < << ==
> >> × ×dT ÷ ÷dT
° · 0 1 -1 1/x
1-x A^-1 Cross Determinant Distance Filter Invalid Get Type
IsInfinity IsNaN IsNull Mask Matrix Element -n NAND
NOR Normalized NotNull Pack Columns Pack rgba Pack Rows Pack xy
Pack xyz Pack xyzw Project Reflect ROL ROR To String
Transpose Unpack Columns Unpack Rows Unpack xy Unpack xyz Unpack xyzw
XNOR