Java Data Type Tutorial - Java StrictMath.acos(double a)








Syntax

StrictMath.acos(double a) has the following syntax.

public static double acos(double a)

Example

In the following code shows how to use StrictMath.acos(double a) method.

/*from  w w  w .  j av  a  2 s .  c  o m*/
public class Main {

  public static void main(String[] args) {
  
    double d1 = 0.90 , d2 = 5.00;
    
    System.out.println("arc cosine value of " + d1 + " = " + 
           StrictMath.acos(d1));

    // returns NaN if argument is NaN or its absolute value is greater than 1
    System.out.println("arc cosine value of " + d2 + " = " + 
           StrictMath.acos(d2));
  }
}

The code above generates the following result.