Isqrt (integer square root) of X: Difference between revisions
Content added Content deleted
Line 3,768: | Line 3,768: | ||
%% isqrt/3 -- Find integer square root and remainder. |
%% isqrt/3 -- Find integer square root and remainder. |
||
isqrt(X, R) :- isqrt(X, R, _). |
isqrt(X, R) :- isqrt(X, R, _). |
||
%%isqrt(0, 0, 0). |
|||
isqrt(X, R, Z) :- pow4gtx(X, Q), |
isqrt(X, R, Z) :- pow4gtx(X, Q), |
||
isqrt(X, Q, 0, X, R, Z). |
isqrt(X, Q, 0, X, R, Z). |
||
Line 3,865: | Line 3,864: | ||
71 1,004,525,211,269,079,039,999,221,534,496,697,502,180,541,686,174,722,466,474,743 1,002,260,051,717,656,279,450,068,093,686 |
71 1,004,525,211,269,079,039,999,221,534,496,697,502,180,541,686,174,722,466,474,743 1,002,260,051,717,656,279,450,068,093,686 |
||
73 49,221,735,352,184,872,959,961,855,190,338,177,606,846,542,622,561,400,857,262,407 7,015,820,362,023,593,956,150,476,655,802</pre> |
73 49,221,735,352,184,872,959,961,855,190,338,177,606,846,542,622,561,400,857,262,407 7,015,820,362,023,593,956,150,476,655,802</pre> |
||
=={{header|Python}}== |
=={{header|Python}}== |