Yotsuba Games
Back to Node List

Numeric Compare

compare

Compares two numbers and returns true or false

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
A
a
Number
Required
比べる1つ目の数値です
B
b
Number
Required
比べる2つ目の数値です

Output Ports

NameTypeDescription
結果
result
Bool
比べた結果です

Parameters

NameTypeDefaultRangeDescription / Options
比べ方
op
Enum
Equal—

A と B をどう比べるか選びます

  • 同じEqual
    |A - B| が 1e-9 未満なら true です
  • 違うNotEqual
    |A - B| が 1e-9 以上なら true です
  • A が B より小さいLessThan
    A が B より小さい時に true です
  • A が B 以下LessEqual
    A が B 以下の時に true です
  • A が B より大きいGreaterThan
    A が B より大きい時に true です
  • A が B 以上GreaterEqual
    A が B 以上の時に true です

What is it for?

  • Testing whether a value has crossed a threshold
  • Producing a Bool for the condition of a Switch
  • Building a condition such as "move only while this value is greater than 0"

Overview

Compares two numbers and returns true or false. It is the entry point for adding conditions to a graph. Connect its Bool output to a switch condition or to the on/off input of a gate.

Usage tips

  • The standard three-node pattern is value → compare (against a threshold) → switch (or gate). This creates step changes such as changing color after time passes 0.5.
  • Pairing it with a waveform creates a periodic condition. motion (Wobble) → compare (GreaterThan 0) yields true only during the first half of the wave, effectively a Bool version of a square wave.
  • Equal / NotEqual use a fixed absolute-difference threshold of 1e-9, not exact equality. Use Value Match's approximate mode when you need a configurable tolerance.

Related nodes

  • switch — choose a value from the comparison result
  • gate — stop a chain based on the comparison result
  • value_match — test equality for text, colors, and other non-numeric values
  • expression_float — write compound conditions as an expression

Comparison modes

  • Equal
    • Returns true when |A - B| is less than 1e-9.
  • NotEqual
    • Returns true when |A - B| is at least 1e-9.
  • LessThan
    • Returns true when A is less than B.
  • LessEqual
    • Returns true when A is less than or equal to B.
  • GreaterThan
    • Returns true when A is greater than B.
  • GreaterEqual
    • Returns true when A is greater than or equal to B.

Notes

  • This node is numeric only.
  • You can mix Int and Float inputs.
  • The fixed 1e-9 threshold for Equal / NotEqual cannot be changed in the Inspector.
  • To test whether text, colors, or other values are equal or different, use Value Match.

Examples

  1. Compare the result of Math Op with 0.5 using GreaterThan
    • Tests whether it exceeds 0.5.
  2. Compare with 0 using Equal
    • Tests whether the input is 0.
  3. Compare Numeric Input with 100 using LessEqual
    • Produces true only when the input is 100 or less.
  4. Connect the result of Compare to Switch
    • This is the basic branching pattern.
Back to Node List
Numeric Compare — PixPipeline Node Reference