← modulo operator page · numeric/modulo/sc_sc/negative_divisor
pandas ✅ · DuckDB ✅
the sign of the remainder when the divisor is negative: mod(SC_1, SC_2) with SC_1 = 5 and SC_2 = -2.
Modulo: "mod ( 5, -2 ) gives -1".
SC_r = -1, an Integer: the remainder takes the sign of the divisor.
SC_r := mod(SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| 5 | -2 |
{
"scalars": [
{"name": "SC_1", "type": "Integer"},
{"name": "SC_2", "type": "Integer"}
]
}
{
"scalars": [
{
"name": "SC_r",
"type": "Integer",
"value": "-1"
}
]
}