A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Programmer Certification (SCJP/OCPJP)
Joined: Oct 14, 2004
Oct 18, 2004 02:40:00
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()
Joined: Aug 03, 2002
Oct 18, 2004 04:59:00
Please take the time to read the Java API for
There is an explanation in the description of the round methods.
Ask a Meaningful Question
Getting someone to think and try something out is much more useful than just telling them the answer.
Joined: Oct 04, 2004
Oct 18, 2004 06:53:00
can u please tell me whether these type of question comes in
exam or not.
I agree. Here's the link:
Math.round (from Poddar exam)
converting a float to an integer?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014