# Math::Modulo
Returns the remainder after dividing I1 by I2
Math::Modulo
I1
I2
O
# Inputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
input_1 | I1 | Input #1 | NUMBER | 0 | Input #1 (dividend) |
input_2 | I2 | Input #2 | NUMBER | 1 | Input #2 (divisor) |
# Outputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
output | O | Output | NUMBER | 0 | Output |
# Configuration
| ID | Name | Type | Default | Unit | Description |
|---|---|---|---|---|---|
trigger_on_input_1 | Trigger on Input #1 | BOOLEAN | true | When enabled, changes to Input #1 trigger output recalculation | |
trigger_on_input_2 | Trigger on Input #2 | BOOLEAN | true | When 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)
}
