You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ROUND function returns FP result for FP value #1138
@Yury-Fridlyand Currently if you put a double in you get a double out, and if you put a long in you get a long out.
If you put a double into round(x) should it return a long always? If you put a double into round(x, y) you can specify how many decimal points to return so sometimes it would have decimals and sometimes it wouldn't, should this always return a double?
I expected round(double x) to return long and java's Math.round does. On another hand, MySQL returns double in that case, and we're aligning with MySQL.
Probably I got confused between these two behaviours and it is not a bug actually.
Activity
matthewryanwells commentedon Jun 9, 2023
@Yury-Fridlyand Currently if you put a double in you get a double out, and if you put a long in you get a long out.
If you put a double into round(x) should it return a long always? If you put a double into round(x, y) you can specify how many decimal points to return so sometimes it would have decimals and sometimes it wouldn't, should this always return a double?
Yury-Fridlyand commentedon Jun 13, 2023
I expected
round(double x)to returnlongand java'sMath.rounddoes. On another hand, MySQL returnsdoublein that case, and we're aligning with MySQL.Probably I got confused between these two behaviours and it is not a bug actually.