+ 4
Why does // throw out the wrong number here by rounding down?
5 Answers
+ 5
Didi
Hope you will find your answer here.
https://stackoverflow.com/questions/38588815/rounding-errors-in-JUMP_LINK__&&__python__&&__JUMP_LINK-floor-division
Edit: I didn't understand the problem at first.
+ 3
Yeah but 1000/1.6 is 625....
+ 2
Because "//" is the floor division operator and rounds down the result to the nearest integer.
To understand more about it, check it out:
https://www.codingem.com/JUMP_LINK__&&__python__&&__JUMP_LINK-floor-division/
Hope it helps!
Happy Coding š¤
+ 2
Thanks, I won't use the floor operator then because of the rounding issue and use int(x/y) instead. šš