Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2003, 01:16 AM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kaizer Send a message via Yahoo to kaizer
Default More info on Math.ceil() and more...

Hi people,

There are actually two queries in this post.

a] I have not fully grasped the idea of Math.floor() and Math.ceil() methods. Can someone elaborate what each does, pref. with an example on it's practical usage?

b] I faintly recall a way in which all the methods of the Math class, (including their argument types and return types) being listed using a command. Is the command javap? or is it javadoc? A friend of mine could do this and he showed me how...now i cant recall how he did it. Could you help me out with this? The main reason i want this method is to primarily look at the different packages / classes / methods of the Math.* package (their arguments and return types). Also this will help me look at other packages (java.lang for instance).

Any pointers on the internet to either / both the queries above would be greatly appreciated.

Thanks
Have a nice day,
Kaizer.

Kaizer Billimoria
Bangalore, India
__________________
Kaizer Billimoria
Bangalore, India
 
Old December 20th, 2003, 10:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

JavaDoc can be found here: C:\j2sdk1.4.0\docs\index.html

Cheers

Martyn
 
Old December 20th, 2003, 10:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ceil round up and floor rounds down.

Math.floor(2.645); // returns 2.0

Math.ceil(2.645); // returns 3.0

Math.round(2.500); // returns 3.0

Math.round(2.499); // returns 2.0


Cheers

Martyn
 
Old December 21st, 2003, 11:17 PM
Authorized User
 
Join Date: Dec 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kaizer Send a message via Yahoo to kaizer
Default

Hi Martyn,
Thanks buddy. you're always there when we need you!

Take care,
Kaiz.

P.S. could you also take a peek at my other post regarding the rounding problem if you have the inclination and the time and let me know what the hassle is with it?:)

THanks,
Kaiz.

Kaizer Billimoria
Bangalore, India





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with Math.pow trryan5 Java Basics 4 July 27th, 2007 06:12 AM
Math operators nguyendh BOOK: Ivor Horton's Beginning Visual C++ 2005 1 June 25th, 2006 01:35 AM
Math question dparsons ASP.NET 1.0 and 1.1 Professional 5 June 14th, 2006 02:31 PM
York Math -- regarding... vijayk Wrox Book Feedback 0 February 5th, 2005 06:23 AM
math.floor casper BOOK: Beginning Java 2 1 October 29th, 2004 11:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.