# Numeric predicate
Numeric predicate
V
O
# 入力
| ID | 略称 | 名前 | 型 | デフォルト | 説明 |
|---|---|---|---|---|---|
value | V | value | NUMBER | 0 |
# 出力
| ID | 略称 | 名前 | 型 | デフォルト | 説明 |
|---|---|---|---|---|---|
output | O | output | BOOLEAN | false |
# 設定
| ID | 名前 | 型 | デフォルト | 単位 | 説明 |
|---|---|---|---|---|---|
operator | operator | ENUM | 0 | 詳細: 値: Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand | operand | NUMBER | 0.0 | 詳細: 表示条件 operator = Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand_2 | operand_2 | NUMBER | 0.0 | 詳細: 表示条件 operator = Between> operand |
# ソースコード
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)
