sqrt Example
10! Please note SQRT and SQR are exactly the same. In fact,
20! SQRT is parced to mean SQR.
30 Number=49
40 COMPLEX Z
50 Z=CMPLX(4,7)
60 CLEAR SCREEN
70 PRINT "The squre root of ";Number;" is:";SQR(Number)
80 PRINT
90 PRINT "Testing the square root of complex numbers."
100 X=REAL(SQR(Z))
110 Y=SQR((SQR(REAL(Z)^2+IMAG(Z)^2)+REAL(Z))/2)
120 PRINT X;"=";Y
130 IF (X=Y) THEN PRINT "Check"
140 X=IMAG(SQR(Z))
150 Y=SGN(Z)*SQR((SQR(REAL(Z)^2+IMAG(Z)^2)-REAL(Z))/2)
160 PRINT X;"=";Y
170 IF (X=Y) THEN
180 PRINT "Check"
190 ELSE
200 PRINT "What a minute. What is the Y for?"
210 END IF
220 PRINT
230 Drawtriangle
240 PRINT "Given a^2 + b^2 = c^2, then c = sqr(a^2 + b^2)"
250 A=3
260 B=4
270 C=SQR(A^2+B^2)
280 PRINT "a = ";A
290 PRINT "b = ";B
300 PRINT "c = ";C
310 END
320 SUB Drawtriangle
330 PRINT " |\"
340 PRINT "a| \ c"
350 PRINT " +++++"
360 PRINT " b"
370 SUBEND