Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to show the use of some Math Methods

Posted By: Gustavo Costa     Category: Java     Views: 2584

A Java Program to show the use of some Math Methods.

Code for Program to show the use of some Math Methods in Java

publicclass JAVA_014
 {

    publicstaticvoid main(String[] args)
    {
       System.out.println("*********  Trigonometric Functions  *********");
       System.out.println("Sin(90) in radian = " + Math.sin(90) );
       System.out.println("Cos(90) in radian = " + Math.cos(90) );
       System.out.println("Tan(90) in radian = " + Math.tan(90) );
       System.out.println("Sin-1(90) in radian = " + Math.asin(90) );
       System.out.println("Cos-1(90) in radian = " + Math.acos(90) );
       System.out.println("Tan-1(90) in radian = " + Math.atan(90) );

       System.out.println("\n*********  Mathematical Functions  *********");
       System.out.println("sqrt(36)  = " + Math.sqrt(36) );
       System.out.println("exp(2)  = " + Math.exp(2) );
       System.out.println("log(1) natural logrithm = " + Math.log(1) );
       System.out.println("pow(3,3)  = " + Math.pow(3,3) );
       System.out.println("random( ) between 0.0 & 1.0 = " + Math.random( ) );

       System.out.println("\n*********  Numerical Functions  *********");
       System.out.println("abs(-36)  = " + Math.abs(-36) );
       System.out.println("ceil(2.43)  = " + Math.ceil(2.43) );
       System.out.println("floor(2.43)  = " + Math.floor(2.43) );
       System.out.println("round(2.43)  = " + Math.round(2.43) );
       System.out.println("rint(2.43)  = " + Math.rint(2.43) );
       System.out.println("min(3,5)  = " + Math.min(3,5) );
       System.out.println("max(3,5)  = " + Math.max(3,5) );
       System.out.println("IEEEremainder(7,3)  = " + Math.IEEEremainder(7,3) );
    }
 }
  
Share: 


Didn't find what you were looking for? Find more on Program to show the use of some Math Methods Or get search suggestion and latest updates.

Gustavo  Costa
Gustavo Costa author of Program to show the use of some Math Methods is from Salvador, Brazil.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!