# Math::Modulo

Process

Returns the remainder after dividing I1 by I2

Math::Modulo
I1
I2
O

# Inputs

IDAbbrevNameTypeDefaultDescription
input_1I1Input #1NUMBER0Input #1 (dividend)
input_2I2Input #2NUMBER1Input #2 (divisor)

# Outputs

IDAbbrevNameTypeDefaultDescription
outputOOutputNUMBER0Output

# Configuration

IDNameTypeDefaultUnitDescription
trigger_on_input_1Trigger on Input #1BOOLEANtrueWhen enabled, changes to Input #1 trigger output recalculation
trigger_on_input_2Trigger on Input #2BOOLEANtrueWhen enabled, changes to Input #2 trigger output recalculation

# Source Code

View Volang source
channel = input::channel()

trigger = false
if (channel == "input_1" and config::get("trigger_on_input_1")) {
    trigger = true
}
if (channel == "input_2" and config::get("trigger_on_input_2")) {
    trigger = true
}

if (!trigger) {
    return
}

i1 = input::get("input_1")
i2 = input::get("input_2")
if (i2 != 0) {
    output::set("output", i1 % i2)
} else {
    output::set("output", 0)
}
Returns the remainder after dividing I1 by I2