← subtraction operator page · numeric/subtraction/sc_sc/negative_result

Negative result 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

the difference of two integer scalars when it is negative: SC_1 - SC_2 with SC_1 = 3 and SC_2 = 5.

Manual:

Subtraction: "3 - 5 gives -2".

Expected:

SC_r = -2, an Integer.

script.vtl ⇩

SC_r := SC_1 - SC_2;

input/scalars.csv ⇩

SC_1SC_2
35

input/scalars.json ⇩

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

expected/scalars.json ⇩

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