SQLite Forum

Fail to calculate long expression
Login
Again, different languages ⇒ different operator rules.

SQLite: `select 7530/(-396)` gives -19

Python: `7530/(-396)` gives -20

Python division is actually called _floor division_: a / b is floor(a div b)

To get the same result as Python's in SQLite: `SELECT floor(1.0*7530/(-396))`