# Numeric predicate
Ocenia wartość numeryczną względem skonfigurowanego operatora porównania, zwracając wynik logiczny.
Numeric predicate
V
O
# Wejścia
| ID | Skrót | Nazwa | Typ | Domyślnie | Opis |
|---|---|---|---|---|---|
value | V | Wartość | NUMBER | 0 | Wartość numeryczna do oceny. |
# Wyjścia
| ID | Skrót | Nazwa | Typ | Domyślnie | Opis |
|---|---|---|---|---|---|
output | O | Wyjście | BOOLEAN | false | Wyjście logiczne, prawdziwe gdy wartość spełnia porównanie. |
# Konfiguracja
| ID | Nazwa | Typ | Domyślnie | Jednostka | Opis |
|---|---|---|---|---|---|
operator | Operator | ENUM | 0 | Operator porównania. Szczegóły: Wartości: Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand | Operand | NUMBER | 0.0 | Wartość referencyjna do porównania. Szczegóły: Widoczne gdy operator = Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand_2 | Operand 2 | NUMBER | 0.0 | Górna granica zakresu dla operatora 'Między'. Szczegóły: Widoczne gdy operator = Between> operand |
# Kod źródłowy
Pokaż kod Volang
value = input::get("value")
operator = config::get("operator") // 0=GT, 1=GTE, 2=EQ, 3=NEQ, 4=LT, 5=LTE, 6=Between
operand = config::get("operand")
result = false
if (operator == 0) { // Greater than
result = value > operand
} else if (operator == 1) { // Greater or equal
result = value >= operand
} else if (operator == 2) { // Equal
result = value == operand
} else if (operator == 3) { // Not equal
result = value != operand
} else if (operator == 4) { // Less than
result = value < operand
} else if (operator == 5) { // Less or equal
result = value <= operand
} else if (operator == 6) { // Between (inclusive)
operand_2 = config::get("operand_2")
result = (value >= operand) and (value <= operand_2)
}
output::set("output", result)
