isqrt
integer square root
iroot
integer n^th root
Calling Sequence
Parameters
Description
Thread Safety
Examples
isqrt(x)
iroot(x, n, 'exact')
x
-
integer
n
exact
(optional) name
The isqrt function computes an integer approximation to the square root of x. The approximation is exact for perfect squares, and the error is less than 1 otherwise. Note: if x<0, isqrt(x) returns 0.
The iroot function computes an integer approximation to the n^th root of x. The approximation is exact for perfect powers, and the error is less than 1 otherwise. If the optional third argument is given, it is set to true or false to show whether the root is exact or not. Note: if x<0, and n is even, iroot(x, n) returns 0; if x<0, and n is odd, iroot(x, n) returns - iroot(- x, n).
The isqrt command is thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
isqrt⁡4
2
isqrt⁡5
isqrt⁡8
3
isqrt⁡10
iroot⁡100,3
5
iroot⁡10,2,exact;exact
false
iroot⁡50653,3,exact;exact
37
true
iroot⁡200,8
If x<0, isqrt(x) returns 0.
isqrt⁡−4
0
The iroot command will calculate odd roots of negative numbers.
iroot⁡−27,3,exact;exact
−3
iroot⁡−500,5,exact;exact
See Also
issqr
NumberTheory[ModularRoot]
NumberTheory[ModularSquareRoot]
psqrt
sqrt
Download Help Document