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

Zero divisor 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

a scalar division by 0: SC_1 / SC_2 with SC_1 = 3 and SC_2 = 0.

Manual:

Division: "If op2 is 0 then the operation generates a run-time error."

Expected:

an error and no value: "If op2 is 0 then the operation generates a run-time error". The error is 2-1-15-6, "At op {op}: Scalar division by Zero."

script.vtl ⇩

SC_r := SC_1 / SC_2;

input/scalars.csv ⇩

SC_1SC_2
30

input/scalars.json ⇩

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

expected/error.json ⇩

{
  "code": "2-1-15-6"
}