StrictMath.acos() in Java

StrictMath.acos(): This method is available in java.lang.StrictMath lass of Java.

Syntax:

double java.lang.StrictMath.acos(double a)

This method takes one argument of type double as its parameter. This method returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.

Special case:

1. If the argument is NaN or its absolute value is greater than 1, then the result is NaN.

Parameters: One parameter is required for this method.

a: the value whose arc cosine is to be returned.

Returns: the arc cosine of the argument.

Exceptions: NA

Approach

Java

public class StrictMathacos {
    public static void main(String[] args) {

        double a = -0.89;
        System.out.println(StrictMath.acos(a));
    }
}

Output:

2.6681414963177272


No comments:

Post a Comment