This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
check out the API for Math.round(double) Returns the closest long to the argument. The result is rounded to an integer by adding 1/2, taking the floor of the result, and casting the result to type long. In other words, the result is equal to the value of the expression: (long)Math.floor(a + 0.5d) So... it behaves just like it's supposed to.
Joined: Feb 07, 2003
Yea...I read that also. Is it just me or does this seem strange? Just as a check excel and MS SQL Server both feel that -.5 should be rounded to -1. :roll: