Isqrt (integer square root) of X: Difference between revisions
Content added Content deleted
(→{{header|Raku}}: Add thousands separators as required by task description.k) |
|||
Line 2,931: | Line 2,931: | ||
Quadratic residue algorithm follows: |
Quadratic residue algorithm follows: |
||
<lang perl6>use Lingua::EN::Numbers; |
<lang perl6>use Lingua::EN::Numbers; |
||
sub isqrt ( \x ) { my ( $X, $q, $r, $t ) = x, 1, 0 ; |
sub isqrt ( \x ) { my ( $X, $q, $r, $t ) = x, 1, 0 ; |
||
$q +<= 2 while $q ≤ $X ; |
$q +<= 2 while $q ≤ $X ; |