jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Math.round() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Math.round()" Watch "Math.round()" New topic


nachagoni rishi

Joined: Oct 14, 2004
Posts: 26
how does Math.round work?
does it add 0.5 and do a ceil() or floor() depending on the number after the decimal point
it adds 0.5 and always does a Math.floor()
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please take the time to read the Java API for Math.
There is an explanation in the description of the round methods.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Arnab karmakar
Ranch Hand

Joined: Oct 04, 2004
Posts: 46
hi barry,

can u please tell me whether these type of question comes in SCJP exam or not.
I agree. Here's the link: http://aspose.com/file-tools
subject: Math.round()
It's not a secret anymore!