cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
Deriving nth root
Deriving nth root
Dec 4, 2010 at 8:11pm UTC
QWERTYman
(461)
As it's more of a mathematical question than a programming question, I put it here.
How do computers calculate the nth root of a number? Is it some relatively obscure formula?
Dec 4, 2010 at 9:14pm UTC
Athar
(4466)
You could check the the pow source code if you want to see for yourself.
powf from the math library:
http://netmite.com/android/mydroid/bionic/libm/src/e_powf.c
Dec 4, 2010 at 10:09pm UTC
Bazzy
(6281)
There are many ways a computer can approximate a function which may result in an irrational number
Wiki shows an algorithm to find the nth-root of an integer:
http://en.wikipedia.org/wiki/Nth_root#Computing_principal_roots
Dec 6, 2010 at 5:23am UTC
rocketboy9000
(562)
They use a general power algorithm, then pass in 1/n.
Dec 9, 2010 at 1:30am UTC
ne555
(10692)
a^
(1/n)
= exp( ln( a^
(1/n)
) = exp( ln(a)/n )
Topic archived. No new replies allowed.