Facebook Page Twitter Page LinkedIn Page
× C# Tutorial C# Advanced C# Resources


The C# Math Cbrt() method returns the cube root of the given number. In special cases it returns the following:

  • If the argument is NaN, then method returns NaN.

Syntax

public static float Cbrt (float arg);

Parameters

arg Specify a number.

Return Value

Returns the cube root of the specified number.

Example:

In the example below, Cbrt() method is used to find out the cube root of the given number.

using System;

class MyProgram {
  static void Main(string[] args) {
    Console.WriteLine(Math.Cbrt(25)); 
    Console.WriteLine(Math.Cbrt(30)); 
    Console.WriteLine(Math.Cbrt(35.5)); 
    Console.WriteLine(Math.Cbrt(-25));
  }
}

The output of the above code will be:

2.924017738212866
3.107232505953859
3.286569225721215
-2.924017738212866

❮ C# Math Methods

5