Question: /** * Updates {@code n} to the {@code r}-th root of its incoming value. * * @param n * the number whose root to compute
| /** * Updates {@code n} to the {@code r}-th root of its incoming value. * * @param n * the number whose root to compute * @param r * root * @updates n * @requires r >= 2 * @ensures n ^ (r) <= #n < (n + 1) ^ (r) */ public static void root(NaturalNumber n, int r) {...}
If I can't use the root funciton of Natural Number then how would I implement this code? |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
