# Math::Max

Process
Math::Max
I1
I2
I3
I4
O

# 入力

ID略称名前デフォルト説明
input_1I1input_1NUMBER-9223372036854775807
input_2I2input_2NUMBER-9223372036854775807
input_3I3input_3NUMBER-9223372036854775807
input_4I4input_4NUMBER-9223372036854775807

# 出力

ID略称名前デフォルト説明
outputOoutputNUMBER0

# ソースコード

Volang ソースを表示
i = 1
empty = -9223372036854775807
max = empty
while (i<=4) {
    input = input::get(str::fmt("input_{}", i))
    // check if input was provided any value by comparing to a default value of min(i64)
    hasValue = input != empty
    if (hasValue) {
        if (input > max or max == empty) {
            max = input
        }
    }
    i += 1
}

fn round2decimal(value) {
    return math::round(100.0 * value) / 100.0
}

output::set("output", round2decimal(max))
Voldeno スマートホーム自動化における Math::Max Logic Block の動作、用途、設定方法を説明します。