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

Content added Content deleted
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 withVTL-2 only has otherunsigned 16-bit language samplesarithmetic, only the roots of 7^1, 7^3 and 7^35 are shown as Q would overflow when the root of 7^57 is calculatedtoo large.
<syntaxhighlight lang="vtl2">
1000 X=0
Line 6,617:
1180 X=X*49
1190 P=P+2
1200 #=P<46*1100
1210 #=9999
2000 A=!
Line 6,642:
Root 7^1(7) = 2
Root 7^3(343) = 18
Root 7^5(16807) = 129
</pre>