Function: sqrtint
Section: number_theoretical
C-Name: sqrtint0
Prototype: GD&
Help: sqrtint(x,{&r}): integer square root y of x, where x is a nonnegative
 integer. If r is present, set it to the remainder x^2 - y.
Description:
 (gen):int sqrtint($1)
Doc: returns the integer square root of $x$, i.e. the largest integer $y$
 such that $y^2 \leq x$, where $x$ a nonnegative integer. If $r$ is present,
 set it to the remainder $r = x - y^2$, which satisfies $0\leq r \leq 2y$
 \bprog
 ? x = 120938191237; sqrtint(x)
 %1 = 347761
 ? sqrt(x)
 %2 = 347761.68741970412747602130964414095216
 ? y = sqrtint(x, &r)
 %3 = 347761
 ? x - y^2
 %4 = 478116
 @eprog
Variant: Also available is \fun{GEN}{sqrtint}{GEN a}.
