← modulo operator page · numeric/modulo/sc_sc/zero_divisor

Zero divisor 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

the result when the divisor is 0: mod(SC_1, SC_2) with SC_1 = 9 and SC_2 = 0.

Manual:

Modulo: "It returns op1 if divisor op2 is 0", and "mod ( 9, 0 ) gives 9".

Expected:

SC_r = 9, an Integer.

script.vtl ⇩

SC_r := mod(SC_1, SC_2);

input/scalars.csv ⇩

SC_1SC_2
90

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Integer"},
    {"name": "SC_2", "type": "Integer"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {
      "name": "SC_r",
      "type": "Integer",
      "value": "9"
    }
  ]
}