You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Dmitry Lychagin <dm...@couchbase.com> on 2018/05/02 20:38:16 UTC

Division operator result when both operands are integers

All,

The recently merged commit for ASTERIXDB-2378 [1] changes the result of the division operator (/) in some cases.
The / operator now returns a double value if both arguments are integers (previously it returned an integer value in this case).
This commit also introduces DIV operator that also does division but returns an integer value if both arguments are integers.

So, before this change we had:
Integer / Integer - > Integer

Now we have:
Integer / Integer -> Double
Integer DIV Integer -> Integer

These two operators are equivalent for all other types of arguments.

Please update your queries if they relied on the old behavior (by changing / to DIV).

[1] https://asterix-gerrit.ics.uci.edu/#/c/2630/

Thanks,
-- Dmitry