10 PRINT "PROGRAM FILE 29: EXCEPTION - OVERFLOW OF NUMERIC EXPRESSIONS."
20 PRINT "    ANSI STANDARD 7.5"
30 PRINT
40 PRINT "THIS PROGRAM TESTS VARIOUS CASES OF NUMERIC OVERFLOW."
50 PRINT
60 PRINT "SECTION 29.1: POSITIVE OVERFLOW"
70 PRINT
80 PRINT "THIS SECTION TESTS THE RESULT OF EXPRESSION EVALUATION"
90 PRINT "EXCEEDING POSITIVE MACHINE INFINITY."
100 PRINT
110 PRINT "TO PASS THIS TEST:"
120 PRINT
130 PRINT "    1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
140 PRINT "       DISPLAYED, AND"
150 PRINT
160 PRINT "    2) POSITIVE INFINITY MUST BE SUPPLIED AS THE VALUE"
170 PRINT "       OF THE EXPRESSION AND EXECUTION CONTINUES."
180 PRINT
190 PRINT "               BEGIN TEST"
200 PRINT
210 LET M=10
220 LET F=1
230 LET A=1E36
240 LET B=1
250 PRINT "ABOUT TO COMPUTE ";A;" * ";M
260 LET A=A*M
270 PRINT "RESULT = ";A
280 PRINT
290 PRINT "----------------------------------------"
300 PRINT
310 IF B>=A THEN 360
320 LET B=A
330 LET F=F*1.1
340 LET M=10^F
350 GOTO 250
360 REM CONVERGE
370 IF A>.99E38 THEN 410
380 PRINT "*** TEST FAILED: VALUE SUPPLIED LESS THAN MINIMUM"
390 PRINT "    POSITIVE MACHINE INFINITY. ***"
400 GOTO 440
410 PRINT "LAST TWO MULTIPLICATIONS SHOULD HAVE BEEN REPORTED"
420 PRINT "AS OVERFLOW, AND POSITIVE INFINITY SUPPLIED; IF SO,"
430 PRINT "*** TEST PASSED *** OTHERWISE *** TEST FAILED ***"
440 PRINT
450 PRINT "                END TEST"
460 PRINT
470 PRINT "SECTION 29.2: NEGATIVE OVERFLOW"
480 PRINT
490 PRINT "THIS SECTION TESTS THE RESULT OF EXPRESSION EVALUATION"
500 PRINT "EXCEEDING NEGATIVE MACHINE INFINITY."
510 PRINT
520 PRINT "TO PASS THIS TEST:"
530 PRINT
540 PRINT "    1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
550 PRINT "       DISPLAYED, AND"
560 PRINT
570 PRINT "    2) NEGATIVE INFINITY MUST BE SUPPLIED AS THE VALUE"
580 PRINT "       OF THE EXPRESSION AND EXECUTION CONTINUES."
590 PRINT
600 PRINT "               BEGIN TEST"
610 PRINT
620 LET M=10
630 LET F=1
640 LET A=-1E36
650 LET B=1
660 PRINT "ABOUT TO COMPUTE ";A;" * ";M
670 LET A=A*M
680 PRINT "RESULT = ";A
690 PRINT
700 PRINT "----------------------------------------"
710 PRINT
720 IF B<=A THEN 770
730 LET B=A
740 LET F=F*1.1
750 LET M=10^F
760 GOTO 660
770 REM CONVERGE
780 IF A<-.99E38 THEN 820
790 PRINT "*** TEST FAILED: VALUE SUPPLIED GREATER THAN MINIMUM"
800 PRINT "    NEGATIVE MACHINE INFINITY. ***"
810 GOTO 850
820 PRINT "LAST TWO MULTIPLICATIONS SHOULD HAVE BEEN REPORTED"
830 PRINT "AS OVERFLOW, AND NEGATIVE INFINITY SUPPLIED; IF SO,"
840 PRINT "*** TEST PASSES *** OTHERWISE *** TEST FAILS *** "
850 PRINT
860 PRINT "                END TEST"
870 PRINT
880 PRINT "END PROGRAM 29"
890 END
