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:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find minimum number of Log value needed to calculate Log upto N
- Square root of a number using log
- Nth root of a number using log
- How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
- Program to compute log a to any base b (logb a)
- Percentage increase in volume of the cube if a side of cube is increased by a given percentage
- Digital Root (repeated digital sum) of square of an integer using Digital root of the given integer
- Smallest root of the equation x^2 + s(x)*x - n = 0, where s(x) is the sum of digits of root x.
- Find the Largest Cube formed by Deleting minimum Digits from a number
- Check if a number can be expressed as power | Set 2 (Using Log)
- Minimum divisor of a number to make the number perfect cube
- Previous perfect square and cube number smaller than number N
- Find square root of number upto given precision using binary search
- Find root of a number using Newton's method
- Square root of a number without using sqrt() function
- Find n-th element in a series with only 2 digits (4 and 7) allowed | Set 2 (log(n) method)
- Find the ln(X) and log10X with the help of expansion
- Find Cube Pairs | Set 1 (A n^(2/3) Solution)
- Find Cube Pairs | Set 2 (A n^(1/3) Solution)
- Find the diagonal of the 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.