Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Math.round(-0.5) returns zero

807606Apr 2 2007 — edited Apr 2 2007
I have a rounding problem with the Math class. The call of the method
Math.round(-0.5)
returns 0, but it should return -1. There must be an error in the Math.round() function.

I am using Ubuntu Linux 6.06 with JDK 1.5.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2007
Added on Apr 2 2007
22 comments
1,007 views