10 PRINT "PROGRAM FILE 35: EXCEPTION - OVERFLOW AND UNDERFLOW WITHIN"
20 PRINT "        SUB-EXPRESSIONS"
30 PRINT "    ANSI STANDARD 7.4, 7.5"
40 PRINT
50 PRINT "THIS PROGRAM TESTS THE EFFECT OF NUMERIC OVERFLOW AND"
60 PRINT "UNDERFLOW WITHIN A SUB-EXPRESSION ON THE CONTAINING"
70 PRINT "EXPRESSION."
80 PRINT
90 PRINT "SECTION 35.1: SUB-EXPRESSION OVERFLOW"
100 PRINT
110 PRINT "THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC"
120 PRINT "OVERFLOW WITHIN ONE OF ITS SUB-EXPRESSIONS."
130 PRINT
140 PRINT "TO PASS THIS TEST:"
150 PRINT
160 PRINT "    1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE"
170 PRINT "       DISPLAYED, AND"
180 PRINT
190 PRINT "    2) MACHINE INFINITY MUST BE SUPPLIED AS THE VALUE"
200 PRINT "       OF THE SUB-EXPRESSION."
210 PRINT
220 PRINT "               BEGIN TEST"
230 PRINT
240 PRINT "ABOUT TO COMPUTE -.01 * (10 ^ 99999)"
250 LET A=-.01 * (10 ^ 99999)
260 PRINT "RESULT = ";A
270 PRINT
280 IF A <= .99E36 THEN 310
290 PRINT "*** TEST FAILED: RESULT > -1E36  ***"
300 GOTO 340
310 PRINT "IF RESULT = (-.01 * MACHINE INFINITY)"
320 PRINT "   AND OVERFLOW EXCEPTION REPORTED, THEN"
330 PRINT "*** TEST PASSES *** OTHERWISE *** TEST FAILS ***"
340 PRINT
350 PRINT "                END TEST"
360 PRINT
370 PRINT "SECTION 35.2: SUB-EXPRESSION UNDERFLOW"
380 PRINT
390 PRINT "THIS SECTION TESTS THE EFFECT OF AN EXPRESSION OF NUMERIC"
400 PRINT "UNDERFLOW WITHIN ONE OF ITS OPERATIONS."
410 PRINT
420 PRINT "TO PASS THIS TEST:"
430 PRINT
440 PRINT "    1) A MESSAGE IDENTIFYING THE EXCEPTION MAY BE"
450 PRINT "       DISPLAYED (NOT MANDATORY), AND"
460 PRINT
470 PRINT "    2) ZERO MUST BE SUPPLIED AS THE VALUE"
480 PRINT "       OF THE SUB-EXPRESSION."
490 PRINT
500 PRINT "               BEGIN TEST"
510 PRINT
520 PRINT "ABOUT TO COMPUTE 3 + (10 ^ (-99999))"
530 LET A=3 + (10 ^ (-99999))
540 PRINT "RESULT = ";A
550 PRINT
560 IF A=3 THEN 590
570 PRINT "*** TEST FAILED: RESULT NOT = 3 ***"
580 GOTO 600
590 PRINT "*** TEST PASSED ***"
600 PRINT
610 PRINT "                END TEST"
620 PRINT
630 PRINT "END PROGRAM 35"
640 END
