Am using Math.round and I am finding that it will not return me any value larger then (2^32/2)-1, but the documentation states it can/will return long values, i.e. 2^64… There a code snippet below.
long bTmp = (long)Math.round(4294967296L);
System.out.println(bTmp);
System.out.println(Long.MAX_VALUE);
which output:
2147483647
9223372036854775807
Am I missing something?
It is calling the overload of
Math.round()which takes afloatand returns anint. Seethe javadoc.
Try: