basic: test prg sqrt.bas

This commit is contained in:
minjaesong
2020-12-02 21:55:13 +09:00
parent 1ef1f5eab8
commit 41bdd30f80
2 changed files with 388 additions and 0 deletions

7
assets/sqrt.bas Normal file
View File

@@ -0,0 +1,7 @@
1 REM Calculates a square root using newtonian method
20 INPUT X
30 Y = 0.5 * X
40 Z = Y
50 Y = Y-(((Y^2)-X)/(2*Y))
60 IF Z <> Y THEN GOTO 40
100 PRINT "Square root of ";X;" is approximately ";Y