Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Array
  • JS String
  • JS Object
  • JS Operator
  • JS Date
  • JS Error
  • JS Projects
  • JS Set
  • JS Map
  • JS RegExp
  • JS Math
  • JS Number
  • JS Boolean
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
Open In App
Next Article:
JavaScript Math hypot( ) Method
Next article icon

JavaScript Math cbrt() Function

Last Updated : 30 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The Javascript Math.cbrt() function is used to find the cube root of a number. The cube root of a number is denoted as Math.cbrt(x)=y such that y^3=x. 

Syntax:

Math.cbrt(number)

Parameters: This function accepts a single parameter.

  • number: The number whose cube root you want to know. 

Return Value: It returns the cube root of the given number.

The below example will give you an idea of cbrt() function:

Example 1: When a positive number is passed as a parameter. 

Javascript




<script type="text/javascript">
    console.log("Output : " + Math.cbrt(8));        
</script>
 
 

Output:

Output : 2

Example 2: When a negative number is passed as a parameter. 

Javascript




<script type="text/javascript">
    console.log("Output : " + Math.cbrt(-8));        
</script>
 
 

Output:

Output : -2

Example 3: When zero is passed as a parameter. 

Javascript




<script type="text/javascript">
    console.log("Output : " + Math.cbrt(0));        
</script>
 
 

Output:

Output : 0

Example 4: When infinity is passed as a parameter. 

Javascript




<script type="text/javascript">
    console.log("Output : " + Math.cbrt(infinity));        
</script>
 
 

Output:

Output : Infinity

We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article.



Next Article
JavaScript Math hypot( ) Method

S

Shubrodeep Banerjee
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • javascript-functions
  • javascript-math

Similar Reads

  • JavaScript Math cbrt() Method
    The Math.cbrt() method is used to find the cube root of a number. Syntax: Math.cbrt(x)Parameters: This method accepts a single parameter as mentioned above and described below: x: This parameter is simply a number whose cube root needs to be found.Returns: It returns the cube root of the given numbe
    3 min read
  • JavaScript Math acos() Method
    The Javascript Math.acos( ) method is used to return the arccosine of a number in radians. The Math.acos() method returns a numeric value between 0 and pi radians. The Math acos() is a static method of Math, therefore, it is always used as Math.acos(), rather than as a method of a Math object create
    3 min read
  • PHP | bcsqrt() Function
    The bcsqrt() function in PHP is an inbuilt function and is used to evaluate the square root of an arbitrary precision number. This function accepts an arbitrary precision number as a string and returns the square root of the number after scaling the result to a specified precision. Syntax: string bc
    2 min read
  • JavaScript Arithmetic Operators
    JavaScript Arithmetic Operators are the operator that operate upon the numerical values and return a numerical value. Addition (+) OperatorThe addition operator takes two numerical operands and gives their numerical sum. It also concatenates two strings or numbers. [GFGTABS] JavaScript // Number + N
    6 min read
  • JavaScript Math hypot( ) Method
    The Math.hypot() method in JavaScript is used to calculate the square root of the sum of squares of numbers passed to it as arguments. It is basically used to find the hypotenuse of a right-angled triangle or the magnitude of a complex number. Math.hypot() method uses the formula Math.sqrt(v1*v1 + v
    3 min read
  • PHP | bcpow() Function
    The bcpow() function in PHP is an inbuilt function and is used to calculate the value of an arbitrary precision base number raised to another exponent number. This function accepts two arbitrary precision numbers as strings and returns the base number raised to exponent after scaling the result to a
    2 min read
  • PHP | bcmul() Function
    The bcmul() function in PHP is an inbuilt function and is used to multiply two arbitrary precision numbers. This function accepts two arbitrary precision numbers as strings and returns the multiplication of the two numbers after scaling the result to a specified precision. Syntax: string bcmul ( $nu
    2 min read
  • PHP | bcmod() Function
    The bcmod() function in PHP is an inbuilt function and is used to calculate modulus of an arbitrary precision numbers. This function accepts an arbitrary precision number and returns the modulus of that number after scaling the result to a specified precision. Syntax: string bcadd ( $dividend, $modu
    2 min read
  • PHP | bcdiv() Function
    The bcdiv() function in PHP is an inbuilt function and is used to divide two arbitrary precision numbers. This function accepts two arbitrary precision numbers as strings and returns the division of the two numbers after scaling the result to a specified precision. Syntax: string bcdiv ( $num_str1,
    2 min read
  • JavaScript Math sqrt() Method
    The JavaScript Math sqrt( ) Method in JavaScript is used to square the root of the number passed as a parameter to the function. Syntax:Math.sqrt(value)Parameters:This method accepts a single parameter as mentioned above and described below: Value: which holds the number whose square root is to be c
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences