StrictMath.cbrt(): This method is available in java.lang.StrictMath class of Java.
Syntax:
double java.lang.StrictMath.cbrt(double a)
This method takes one argument of type double as its parameter. This method returns the cube root of a double value.
Special cases:
1. If the argument is NaN, then the result is NaN.
2. If the argument is infinite, then the result is an infinity with the same sign as the argument.
3. If the argument is zero, then the result is a zero with the same sign as the argument.
Parameters: One parameter is required for this method.
a: a value.
Returns: the cube root of a.
Exceptions: NA
Approach
Java
public class StrictMathcbrt {public static void main(String[] args) {double a = 216;System.out.println(StrictMath.cbrt(a));}}
Output:
6.0
No comments:
Post a Comment