Info

Double Precision BASIC Listing

0 CLS : PRINT " DOUBLE PRECISION ROUTI

NES, ANGLES IN RADIANS (C) JIM E. KING, 1980, PERMISSION TO US E & COPY, NOT TO SELL" : GOTO 9

3 INPUT " FOR DSQR(W>0), R="; W : RETUR N

4 INPUT " FOR DLN(X>0), X="; W : RETURN

5 INPUT " FOR DEXPOK87.34), X="; W : R ETURN

6 INPUT " FOR DSIN(A) S DCOS(A), A="; W A : RETURN

8 INPUT " FOR DASIN(-KX<1), X="; W : R ETURN

9 DEFSTR S : DEFINT I, L : DEFDBL W : W P = 3.1415926535897932

10 PRINT "SQ<R>00T <L>0G <E>"X SIN&<C>0 S ARC<T>AN ARC<S>IN A<~>X" : G0SUB 2

20 IF S = "R" G0SUB 3 : G0SUB 110 : GOS UB 9000 : G0SUB 310 : PRINT " R00T"2= "WY * WY

30 IF S = "L" GOSUB 4 : G0SUB 120 : GOS UB 9020 : GOSUB 320 : W = WY : GOSUB 9040 : GOSUB 330 40 IF S = "E" GOSUB 5 : GOSUB 130 : GOS UB 9040 : GOSUB 330 : W = WY : GOSUB 9020 : GOSUB 320 50 IF S = "C" GOSUB 6 : GOSUB 140 : GOS

UB 9060 : GOSUB 340 : : GOSUB 9100 : GOSUB 350 : W = WY : GOSUB 9150 : GOS UB 360

UB 9100 : GOSUB 350 : GOSUB 9060 : PRINT I/2"D SIN/COS("WA")="WY/W 70 IF S = "S" GOSUB 8 : GOSUB 160 : GOS UB 9150 : GOSUB 360 : GOSUB 9060 : PR INT I"DSIN("WA")="WY 80 IF S = """ GOSUB 500 99 IF S = "/", END ELSE 10 110 U = SQR(W) : PRINT " SQR("W")="U"

R"2="U * U : RETURN 120 U = L0GCW) : PRINT " LN("W")="U : RETURN

130 U = EXP(W) : PRINT " EXPC"W")="

U : RETURN 140 V = SIN(WA) : U = COS(WA) : PRINT " SIN("WA")="V; TAB(36)"C0S

="U TAB(50)"TAN="V/U : RETURN 150 B = ATN(W) : PRINT " ATN("W")="

B : RETURN 160 V = ATNCW/SQRC1 - W * W)) : PRINT "

ASINC'W") ="V : RETURN 310 PRINT "DSQR("W,,)="WY; : RETURN 320 PRINTCI - 3)/2"DLN("W")="WY : RETUR N

330 PRINT I"DEXP("W")="WY : RETURN 340 PRINT I/2"DSIN("WA")="WY TAB(38)"DC 0S="W

: PRINT " DSIN"2 + DC0S*2 - 1 ="W * W

+ WY * WY - 1 : W = WY/W : PRINT " DTAN("WA")="W : R ETURN

350 PRINT(ABSCI) - 1)/2"DATN("W")="WA : RETURN

360 PRINTCI - 3)/2"DASIN("W")="WA : RET URN

500 INPUT "A"X A,X="; W, WX : W = ABS( W) : PRINT "A~X ="W~WX : GOSUB 9020

17) CHR$(27)"D A"X ="WY : RETURN 9000 WY = SQR(W) : WY = WY/2 + W/WY/2 : WY = WY/2 + W/WY/2 : RETURN '-WY=SQR (W)

9030 W1 = WY : W3 = W3 * W2 * W2 : WY = WY + W3/I : I = I + 2 : IF WY <> W1 THEN 9030 ELSE WY = 2 * WY : RETURN 9040 W2 = W : W = ABS(W) : W3 = 1 : WY

W : WY = WY + W3 : IF WY <> W1 THEN 9050 ELSE IF W2 < 0

THEN WY = 1/WY : RETURN ELSE RETURN 9060 WA = WA/2/WP : WA = WA - FIX(WA) + 1 : WA =(WA - FIX(WA)) * 2 * WP : WY = WA : W = 1 : W8 = 1 : W9 = WA : I = 1 : 12 = 1' -

9080 W1 = WY : FOR 11 = 1 TO 2 : I = I + 1 : W9 = W9 * WA/I : NEXT : 12 = -1 * 12

9090 W3 = W : FOR 11 = 1 TO 2 : I = I + 1 : W8 = W8 * WA/I : NEXT : 12 = - 1 * 12

: W = W + 12 * W8 : IF W <> W3 THEN 909 0 ELSE RETURN

9100 W2 = 1/W : W3 = W : I = 3 : IF W = 1 OR W = - 1, WA = SGNCW) * WP/4 : R ETURN

9120 WA = W : IF ABS(W) > 1 THEN WA = S GN(W) * WP/2 : I = 1 : GOTO 9140'- WA =ATN(W)

9130 W5 = WA s W3 = W3 * W * W : WA = W A - W3/I : I = - 1 * SGN(I) *(ABS(I) + 2)

9140 W5 = WA s WA = WA - W2/I : W2 = W2 /W/W : I = - 1 * SGN(I) *(ABS(I) + 2)

RCSIN(W)

9160 W2 = WA : W1 = W1 * W * W : W4 = W 4 * 1/(1 + 1) : I = I + 2 : WA = WA + W4 * W1/I

0 0

Post a comment