mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-17 00:16:04 +09:00
basicdoc: some fixes
This commit is contained in:
10
assets/disk0/home/basic/sqrt2.bas
Normal file
10
assets/disk0/home/basic/sqrt2.bas
Normal file
@@ -0,0 +1,10 @@
|
||||
1 REM Calculates a square root using newtonian method
|
||||
10 INPUT X
|
||||
11 IF TYPEOF(X)=="num" THEN GOTO 20
|
||||
12 PRINT "Please type in a number, please";
|
||||
13 GOTO 10
|
||||
20 Y = 0.5 * X
|
||||
30 Z = Y
|
||||
40 Y = Y-(((Y^2)-X)/(2*Y))
|
||||
50 IF NOT(Z==Y) THEN GOTO 30
|
||||
100 PRINT "Square root of ";X;" is approximately ";Y
|
||||
Reference in New Issue
Block a user