Is there a way to calculate the nth root of a double in objective-c?
I couldn't seem to find an appropriate function.
You have to use the pow function:
pow(d, 1.0/n)
Mathematically, the n-th root of x is x to the power of 1/n.
I have no idea what the syntax of objective-c would be, but basically you just want to use the power function with 1/n as the exponent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With