Calculate a principal nth root
nthRoot(x, n) returns an nth root of x. It generalizes sqrt, which is the second root, and cbrt, the cube root.
Example
nthRoot(81, 4) is 3. It is useful for reversing powers, scaling laws, and geometric formulas. Use pow to verify that raising the result to n returns the input where the branch convention allows it.
Domain cautions
For real arithmetic, even roots of negative values are not real, while odd roots can be. Complex inputs have branch choices, so the returned result is a principal root rather than every possible answer. Use nthRoots when all complex roots are required. The degree should be a meaningful nonzero integer.