10 PRINT "PROGRAM FILE 129: EXCEPTION - OVERFLOW ON VALUE OF"
15 PRINT "        TAN FUNCTION."
20 PRINT "    ANSI STANDARD 8.5"
30 PRINT
40 PRINT "SECTION 129.1: EXCEPTION - OVERFLOW ON VALUE OF"
50 PRINT "        TAN FUNCTION."
60 PRINT
70 PRINT "THE OBJECT OF THIS TEST IS TO SEE WHETHER THE PROCESSOR"
80 PRINT "RECOGNIZES AN EXCEPTION OF THE VALUE RETURNED BY THE"
90 PRINT "TAN FUNCTION EXCEEDS MACHINE INFINITY."
100 PRINT
110 PRINT "TO PASS THIS TEST:"
120 PRINT
130 PRINT "    1) OVERFLOW MUST NOT OCCUR, OR"
140 PRINT
150 PRINT "    2) WHEN OVERFLOW OCCURS, THE PROCESSOR MUST DISPLAY A"
160 PRINT "       MESSAGE IDENTIFYING THE EXCEPTION, SUPPLY MACHINE"
170 PRINT "       INFINITY AND CONTINUE EXECUTION."
180 PRINT
190 PRINT
200 PRINT "                               BEGIN TEST."
210 PRINT
220 PRINT "THE PROGRAM ATTEMPTS TO FORCE CONVERGENCE OF THE ARGUMENT"
230 PRINT "TO PI/2, SO AS TO CAUSE OVERFLOW. IF OVERFLOW DOES NOT"
240 PRINT "OCCUR, IT IS LIKELY THAT THIS SYSTEM HAS NO INTERNAL"
250 PRINT "NUMERIC REPRESENTATION FOR WHICH THE TANGENT EXCEEDS"
260 PRINT "MACHINE INFINITY."
270 PRINT
280 LET A=1.56
290 LET B=1.58
300 PRINT "ARGUMENT","VALUE OF TAN"
310 PRINT
320 LET M=(A+B)/2
330 LET R=TAN(M)
340 PRINT M,R
350 IF M<=A THEN 420
360 IF M>=B THEN 420
370 IF R<0 THEN 400
380 LET A=M
390 GOTO 320
400 LET B=M
410 GOTO 320
420 PRINT
430 PRINT "ARGUMENTS HAVE CONVERGED. IF OVERFLOW HAS OCCURRED,"
440 PRINT "PROCESSOR MUST HAVE REPORTED EXCEPTION AND SUPPLIED"
450 PRINT "MACHINE INFINITY, OTHERWISE,"
455 PRINT "***  TEST FAILED  ***"
460 PRINT
470 PRINT "                                 END TEST"
480 PRINT
490 PRINT "END PROGRAM 129"
500 END
