← floor operator page · numeric/floor/sc/negative_fraction

Negative fraction 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

floor of a negative fraction: floor(SC_1) with SC_1 = -3.1415.

Manual:

Floor: "floor( -3.1415 ) gives -4".

Expected:

SC_r = -4, an Integer: the greatest integer not above the operand, where a truncation would give -3.

script.vtl ⇩

SC_r := floor(SC_1);

input/scalars.csv ⇩

SC_1
-3.1415

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Number"}
  ]
}

expected/scalars.json ⇩

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