- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MathF.Cbrt() Method in C# with Examples
The MathF.Cbrt() method in C# is used to return the cube root of a floating-point value.
Syntax
Following is the syntax −
public static float Cbrt (float val);
Example
Let us now see an example to implement the MathF.Cbrt() method −
using System; class Demo { public static void Main(){ float val1 = 64f; Console.WriteLine("Cube root = "+MathF.Cbrt(val1)); } }
Output
This will produce the following output −
Cube root = 4
Example
Let us now see another example to implement the MathF.Cbrt() method −
using System; class Demo { public static void Main(){ float val1 = 12.67f; Console.WriteLine("Cube root = "+MathF.Cbrt(val1)); } }
Output
This will produce the following output −
Cube root = 2.331268
Advertisements