Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Neha Gap
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

The subject says it all.

Any help would be appreciated.

Thanks,
Neha.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But there is a link in the java.lang.StrictMath javadoc to a file where all the algorithms are written.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!