wood burning stoves*
The moose likes Java in General and the fly likes How can I get the source code for java.Math class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can I get the source code for java.Math class?" Watch "How can I get the source code for java.Math class?" New topic
Author

How can I get the source code for java.Math class?

Neha Gap
Greenhorn

Joined: May 30, 2007
Posts: 29
Hi folks,

The subject says it all.

Any help would be appreciated.

Thanks,
Neha.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

If you have downloaded a Java JDK, you will find a file named "src.zip" in the directory where you installed it. You'll find all of the source code for the Java API in there, all 5000-odd classes.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

The source of java.lang.Math won't help you out much though. Most methods delegate to a similar method in class java.lang.StrictMath, and most of that class' methods are native.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
But there is a link in the java.lang.StrictMath javadoc to a file where all the algorithms are written.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How can I get the source code for java.Math class?