← All exercises

Sign Check

easy

Output Negative, Zero, and Positive flags by comparing a numeric input to zero.

What it teaches

Detect whether a number is negative, zero, or positive. Compare the input to zero and produce three separate flags. A clean way to share a numeric decision with downstream logic — once a comparison is a BOOL, anything else can react to it.

Inputs and outputs

TagTypeDefaultDescription
In_ValueREALNumeric value to evaluate
Sts_NegativeBOOLNegative flag
Sts_ZeroBOOLZero flag
Sts_PositiveBOOLPositive flag

Required behavior

  • Sts_Negative is 1 when In_Value is less than 0.
  • Sts_Zero is 1 when In_Value is exactly 0.
  • Sts_Positive is 1 when In_Value is greater than 0.