Isqrt (integer square root) of X: Difference between revisions
m
→{{header|VTL-2}}: VTL-2 uses unsigned arithmetic, so can handle the root of 7^5
m (Swift - reduced output font size) |
m (→{{header|VTL-2}}: VTL-2 uses unsigned arithmetic, so can handle the root of 7^5) |
||
Line 6,595:
=={{header|VTL-2}}==
The ISQRT routine starts at line 2000. As
<syntaxhighlight lang="vtl2">
1000 X=0
Line 6,617:
1180 X=X*49
1190 P=P+2
1200 #=P<
1210 #=9999
2000 A=!
Line 6,642:
Root 7^1(7) = 2
Root 7^3(343) = 18
Root 7^5(16807) = 129
</pre>
|