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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!