commands → rootint

rootint(A,B)

The rootint command computes the floor of A^(1/B) where A and B are positive integers.

Examples

rootint(16,2);
	4

rootint(24,3);
	2

Algorithm

This algorithm uses a binary search.

References

Gullberg, Jan. Mathematics: From the Birth of Numbers. Norton, 1996.