INPUT "What number do you want to find the square root of:"; n
s = SQRT(n)
PRINT USING "My quess is ######.######, which squared becomes ######.######"; s; s
* s
PRINT USING "The actual value is ######.######, which squared becomes ######.######";
SQR(n
);
SQR(n
) * SQR(n
) PRINT "-----------------------------------------------------------" PRINT i
, SQRT
(i
), SQRT
(i
) * SQRT
(i
)
b = FindBase(n) 'first, find the base, which is the smallest whole number squared that's smaller than our actual number.
step1 = (n / b + b) / 2 'then take the average of that value and your number divided by that value
step2 = n / step1 'get the value of your number divided by that number, for greater precision
SQRT = (step1 + step2) / 2 'and take the average of those two values
FindBase = -1 'not found; value is too large