3150 DATA 0.999939502E+00, 0.100006501E+01 3160 DATA -0.100000000E+01,-0.100000000E+01,-0.100000000E+01 3170 DATA -0.100001501E+01,-0.999989500E+00 3180 DATA -0.100000000E+01, 0.100000000E+01,-0.100000000E+01 3190 DATA -0.100001500E+01,-0.999989500E+00 3200 DATA -0.100000000E+01, 0.800000000E+01, 0.100000000E+01 3210 DATA 0.999919502E+00, 0.100008501E+01 3220 DATA -0.100000000E+01, 0.900000000E+01,-0.100000000E+01 3230 DATA -0.100009501E+01,-0.999909503E+00 3235 REM TEST A^X, -1<A<0 3240 DATA -0.474653000E+00, -0.220000000E+02, 0.131741601E+08 3250 DATA 0.131734994E+08, 0.131748208E+08 3260 DATA -0.225242000E-02, 0.300000000E+01,-0.114274183E-07 3270 DATA -0.114276205E-07,-0.114272160E-07 3280 DATA -0.534278000E-04, 0.600000000E+01, 0.232596807E-25 3290 DATA 0.232593695E-25, 0.232599920E-25 3300 DATA -0.272625000E+00, 0.900000000E+01,-0.831938279E-05 3310 DATA -0.831966244E-05,-0.831910314E-05 3315 REM TEST A^X, 0<A<1 3320 DATA 3330 DATA 3340 DATA 0.363544000E+00, -0.363353000E+02, 0.927457281E+16 0.927270258E+16, 0.927644343E+16 0.463542000E-02,-0.100000000E+01, 0.215730182E+03 3350 DATA 0.215717623E+03, 0.215742742E+03 3380 DATA 0.298746000E-04, -0.263545000E-02, 0.102783787E+01 3390 DATA 0.102783275E+01, 0.102784299E+01 3400 DATA 0.226399000E+00, 0.847574000E+00, 0.283928118E+00 3410 DATA 0.283926132E+00, 0.283930103E+00 3420 DATA 0.998476000E-01, 0.100000000E+01, 0.998476000E-01 0.998451494E-01, 0.998500507E-01 3430 DATA 0.974653000E-01, 0.143654000E+02, 0.298144041E-14 0.298069739E-14, 0.298218360E-14 3440 DATA 3450 DATA 3455 REM TEST 1^X 3460 DATA 3470 DATA 3480 DATA 0.100000000E+01,-0.222222000E+02, 0.100000000E+01 0.999777302E+00, 0.100022725E+01 0.100000000E+01,-0.464533000E-01, 0.100000000E+01 3490 DATA 0.999999035E+00, 0.100000547E+01 3500 DATA 0.100000000E+01, 0.993764000E-01, 0.100000000E+01 3510 DATA 0.999998506E+00, 0.100000600E+01 3520 DATA 0.100000000E+01, 0.187564000E+02, 0.100000000E+01 3530 DATA 0.999811951E+00, 0.100019259E+01 3535 REM TEST A^X, A>1 3540 DATA 3550 DATA 3560 DATA 0.847447000E+03,-0.985743000E+01, 0.136878595E-28 0.136867274E-28, 0.136889917E-28 0.228398000E+01,-0.937362000E+00, 0.461079137E+00 3570 DATA 0.461076363E+00, 0.461081910E+00 3580 DATA 0.933847000E+02, 0.928273000E-01, 0.152368565E+01 3590 DATA 0.152367980E+01, 0.152369149E+01 3600 DATA 0.837363000E+09, 0.298383000E+01, 0.421170346E+27 3610 DATA 0.421081821E+27, 0.421258889E+27 3615 REM TEST A^X, WHERE ABS(A) IS CLOSE TO 1, X IS LARGE 3620 DATA 0.999988000E+00, 0.958576000E+06, 0.100999406E-04 3630 DATA 0.387260445E-05, 0.263410738E-04 3640 DATA -0.999982000E+00, 0.947563000E+06,-0.391334786E-07 3650 DATA -0.100943693E-06,-0.151711334E-07 3660 DATA -0.999937000E+00, 0.976352000E+06, 0.193031627E-26 3670 DATA 0.727071227E-27, 0.512483260E-26 3680 DATA 0.100002000E+01, 0.209746500E+07, 0.165259840E+19 3690 DATA 0.128553554E+10, 0.212444587E+28 3700 DATA -0.100005000E+01, 0.353533000E+06,-0.474984719E+08 3710 DATA -0.162918665E+10,-0.138475470E+07 3720 DATA -0.100005000E+01, 0.958572000E+06, 0.652538506E+21 3730 DATA 0.448505410E+17, 0.949298339E+25 3735 REM TEST A^X, WHERE A^X CLOSE TO LIMITS OF 1E38, 1E-38 3740 DATA 0.576352000E+00, 0.111000000E+03, 0.273115473E-26 0.272911951E-26, 0.273319144E-26 3750 DATA 3760 DATA 0.578746000E+00, -0.145432000E+03, 0.348212882E+35 3770 DATA 0.347934556E+35, 0.348491430E+35 3780 DATA 0.227364000E+01, 0.944756000E+02, 0.502917503E+34 3790 DATA 0.502666781E+34, 0.503168349E+34 3792 DATA 0.233333000E+01,-0.991234000E+02, 0.334927971E-36 3795 DATA 0.334752354E-36, 0.335103676E-36 3799 REM TEST A^X, WHERE A IS CLOSE TO LIMITS OF 1E38, 1E-38 3800 DATA 0.558574000E+38, 0.976453000E-03, 0.108857473E+01 3810 DATA 0.108856963E+01, 0.108857984E+01 3820 DATA 0.576363000E-29, 0.172728000E-01, 0.312575800E+00 3830 DATA 0.312573186E+00, 0.312578414E+00 3840 DATA 0.333737000E+34,-0.953423000E-01, 0.636504568E-03 3850 DATA 0.636498972E-03, 0.636510163E-03 3860 DATA 3870 DATA 0.623147000E-37,-0.936218000E-02, 0.223009693E+01 0.223004499E+01, 0.223014888E+01 5000 DATA 999,0,0,0,0 5010 END PROGRAM FILE 43: ACCURACY OF INVOLUTION ANSI STANDARD 7.2, 7.4, 7.6 *** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA' SECTION 43.1 ACCURACY OF INVOLUTION. THIS SECTION TESTS THE ACCURACY OF INVOLUTION. THE THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD END PROGRAM 43 黃黃 10 PRINT "PROGRAM FILE 44: ELEMENTARY USE OF THE FOR-STATEMENT." 20 PRINT " ANSI STANDARD 11.2, 11.4" 30 PRINT 40 PRINT "SECTION 44.1: ELEMENTARY USE OF THE FOR-STATEMENT." 50 PRINT 60 PRINT "THIS SECTION TESTS A SIMPLE FOR-NEXT CONSTRUCTION WITH" 70 PRINT "A VARIETY OF VALUES FOR THE INITIAL-VALUE, LIMIT, AND" 80 PRINT "INCREMENT. TO PASS THE TEST, THE CONTROL-VARIABLE MUST" 90 PRINT "TAKE ON THE APPROPRIATE VALUES AND THE LOOP MUST BE EXECUTED" 100 PRINT "THE CORRECT NUMBER OF TIMES." 500 LET A1=1.234E20 510 LET B1=-4.321E20 520 LET C1=-8.7E19 530 LET T2=7 540 GOSUB 3000 550 LET A1=0 560 LET B1=0 570 LET C1=-2 580 LET T2=1 590 GOSUB 3000 2000 PRINT 2010 IF F=0 THEN 2040 2020 PRINT "*** TEST FAILED IN ";F;" CASE(S) ***" 3000 REM SUBROUTINE TO TEST VARIOUS VALUES IN THE FOR-LOOP 3010 PRINT 3020 PRINT "LOOP IS: FOR I1=";A1;" TO ";B1;" STEP ";C1 3030 PRINT 3040 PRINT "CONTROL VARIABLE:" 3050 PRINT "SHOULD BE","ACTUAL","RESULT" 3060 LET A2=A1 3070 LET B2=B1 3080 LET C2=C1 3090 LET 12=A2 3100 REM S1 IS ERROR SWITCH 3110 LET S1=0 3120 REM T1 IS LOOP COUNT 3130 LET T1=0 3140 FOR I1=A1 TO B1 STEP C1 3150 LET T1=T1+1 3160 LET M$=" OK 3170 IF I1=0 THEN 3220 3180 LET R=(I2-11)/I1 3190 IF R<-1E-6 THEN 3230 3200 IF R>1E-6 THEN 3230 3210 GOTO 3250 3220 IF 12=0 THEN 3250 3230 LET M$="FAILED" 3240 LET S1=1 3250 PRINT 12,11,M$ 3260 LET 12=12+C2 3270 NEXT I1 3280 PRINT "LOOP EXITED" 3290 LET M$=" OK 11 3300 IF I1=0 THEN 3350 3310 LET R=(I2-11)/I1 3320 IF R<-1E-6 THEN 3360 3330 IF R>1E-6 THEN 3360 3340 GOTO 3380 |