Quote from: ckoehn on December 05, 2019, 06:40:48 amI hate to slow you down because I am anxiously awaiting the new compiler, but I think it would be advantageous to make it as secure as possible. Just my thoughts.
CONST toolbaseID = 100 ' tool starting number/id
INT toolCount = 0 ' menuitems tools number you currently have
ADDMENUITEM (w1, 1, "new tool", 0, toolBaseID + toolCount)
' Square Root by Iteration ..
' Calculating a Square Root using Iteration ..
z = 27 :' positive real number whose Square root is required
print "Square Root of ",z:print:print STRING$(30, "_" )
print:print:print "Iterations: ":print
x = z/2 :' arbitrary start value for the iteration
x = 0.5 * (x + z/x)
until ((x*x - z)/z <= 1.e-11) :' the test for convergence
print "The Square Root of ",z, " is ", x
' Compare with the inbuilt Sqrt() function ..
print "Using the CB Sqrt() Function, the result is .. ":print
print:print STRING$(30, "_" )