sql: integer division should return an integer#3308
sql: integer division should return an integer#3308madelynnblue wants to merge 1 commit intocockroachdb:masterfrom madelynnblue:sql-int-division
Conversation
There was a problem hiding this comment.
this is exactly why we originally decided against integer division. I'm 👎 on this change.
There was a problem hiding this comment.
I'm more on the fence. I think the current behavior is understandable. And I think having integer division result in an integer is also expected given the behavior of other programming languages.
There was a problem hiding this comment.
I prefer int / int -> float. Truncating the results of division to an integer is understandable only because we're used to it from (some) other languages; it's surprising the first time you run across it and I think it's best to regard it as a historical accident. Also, while postgresql and sqlite truncate integer division, mysql does not, so either decision will break compatibility with something.
|
Agreed. Closing. |
Fixes #3271