Given number N, the task is to find the cube root using log function.
Input: N = 8
Input: N = 27
Approach: To solve the problem mentioned above we will use log() function, according to the following formula:
Let cube root of N be d.
=> ∛N = d
=> N(1/3) = d
Now, apply log on both sides:
log3 (N(1/3)) = log3 (d)
=> log3 (d) = 1/3 * log3 (N)
=> d = 3(1/3 * log3 (N))
Below is the implementation of above problem:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Find the Largest Cube formed by Deleting minimum Digits from a number
- Find cubic root of a number
- Find Nth positive number whose digital root is X
- Find root of a number using Newton's method
- C program to find square root of a given number
- Square root of a number without using sqrt() function
- Find square root of number upto given precision using binary search
- Previous perfect square and cube number smaller than number N
- Minimum divisor of a number to make the number perfect cube
- Find the diagonal of the Cube
- Find Cube Pairs | Set 2 (A n^(1/3) Solution)
- Find Cube Pairs | Set 1 (A n^(2/3) Solution)
- Centered cube number
- N-th number which is both a square and a cube
- Perfect cube greater than a given number
- Largest perfect cube number in an Array
- Largest number in an array that is not a perfect cube
- Least number to be added to or subtracted from N to make it a Perfect Cube
- Number of times the largest Perfect Cube can be subtracted from N
- Check if number formed by joining two Numbers is Perfect Cube
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.