Java Math cbrt() Method

Facebooktwitterredditpinterestlinkedinmailby feather

The cbrt() method of Math class returns the cube root of a double value.

Syntax:

public static double cbrt(double a)

Parameters:

The parameter ‘a’ represents the value whose cube root is to be determined.

Return Value:

The cbrt () method returns the cube root of the specified value.

  • It returns NaN, if we pass a NaN.
  • It returns infinity with the same sign as the argument, if we pass a positive infinite argument.
  • If we pass zero as an argument, it will return zero with the same sign as the argument.

Example 1:

 Output:

Example 2:

 Output:

Example 3:

 Output:

Example 4:

Output:

Facebooktwitterredditpinterestlinkedinmailby feather