I have a 64-bit long one that I want to round to the nearest 10,000, so I make it simple:
long myLong = 123456789 long rounded = (myLong / 10000) * 10000;
This is similar to what I expect, but since I'm not 100% on the insides of how integer types are divided, I'm just a little worried that there may be situations where this does not work properly.
Will this work with very large numbers / extreme cases?
source share