i am new in Java. i would like to know how to find the nth root of any positive number using recursion. Is there any way i can do this without using math.pow()?

Recommended Answers

All 2 Replies

@thetechie , welcome to daniweb :)

regarding the problem above , have you tried writing some code? or do you want some algorithm of sorts? if you have some code, you can post it here , it would help the members to help you...

to answer your question , try using this method :

r^n = x.
therefore , ln r = ( ln x )/n
therefore , r = exp ((ln x)/n)

where : x = number , r = nth root.
hope it helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.