StrictMath cbrt() Method in Java Last Updated : 13 Dec, 2021 Comments Improve Suggest changes Like Article Like Report The java.lang.StrictMath.cbrt() is an inbuilt method in Java which is used to return the cube root of a given double value. The method shows three special results: The result is a zero with the same sign as the argument when the given argument is zero.The result is infinity with the same sign of argument when the argument is infinite.The result is NaN when the given argument is NaN. Syntax: public static double cbrt(double num) Parameters: This method accepts one parameter num which is of double type whose cube root is required to be found.Return Value : The method returns the cube root of num.Below programs illustrate the java.lang.StrictMath.cbrt() method: Program 1: java // Java program to illustrate the // java.lang.StrictMath.cbrt() import java.lang.*; public class Geeks { public static void main(String[] args) { double val1 = 8.05, val2 = 27, val3 = 0; // It returns the cube root of a double value double cbrtvalue = StrictMath.cbrt(val1); System.out.println("Cube root of "+val1+ " = " + cbrtvalue); cbrtvalue = StrictMath.cbrt(val2); System.out.println("Cube root of "+val2+ " = " + cbrtvalue); cbrtvalue = StrictMath.cbrt(val3); System.out.println("Cube root of "+val3+ " = " + cbrtvalue); } } Output: Cube root of 8.05 = 2.0041580161269152 Cube root of 27.0 = 3.0 Cube root of 0.0 = 0.0 Program 2: java // Java program to illustrate the // java.lang.StrictMath.cbrt() import java.lang.*; public class Geeks { public static void main(String[] args) { double val1 = -8.05, val2 = 128, val3 = 0; // It returns the cube root of a double value double cbrtvalue = StrictMath.cbrt(val1); System.out.println("Cube root of "+val1+ " = " + cbrtvalue); cbrtvalue = StrictMath.cbrt(val2); System.out.println("Cube root of "+val2+ " = " + cbrtvalue); cbrtvalue = StrictMath.cbrt(val3); System.out.println("Cube root of "+val3+ " = " + cbrtvalue); } } Output: Cube root of -8.05 = -2.0041580161269152 Cube root of 128.0 = 5.039684199579493 Cube root of 0.0 = 0.0 Create Quiz Comment A ankita_chowrasia Follow 0 Improve A ankita_chowrasia Follow 0 Improve Article Tags : Java Java-lang package Java-Functions Java-StrictMath Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management3 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like