Isqrt (integer square root) of X: Difference between revisions

m
Line 5,816:
end
</syntaxhighlight>
An alternate version of isqrt() that can handle the full range of S-BASIC integer values (well, almost: it will fail for 32,767) looks like this.
<syntaxhighlight lang="basic">
function isqrt(x = integer) = integer
Line 5,830:
</syntaxhighlight>
{{out}}
The output for 7^5 will be shown only if the alternate version of the function is used.
<pre>
Integer square root of first 65 numbers
Line 5,842 ⟶ 5,843:
1 7 2
3 343 18
5 16807 129
</pre>
 
211

edits