PROGRAM FILE 174: EXCEPTION - EVALUATION OF NUMERIC                             
        EXPRESSIONS IN THE PRINT STATEMENT.                                     
    ANSI STANDARD 7.5, 8.5, 12.2                                                
                                                                                
THIS PROGRAM TESTS THE EFFECT OF THE VARIOUS EXCEPTIONS THAT                    
CAN OCCUR IN NUMERIC EXPRESSIONS IN THE CONTEXT OF THE PRINT                    
STATEMENT.                                                                      
                                                                                
SECTION 174.1: EXCEPTIONAL EXPRESSIONS AS PRINT-ITEMS.                          
                                                                                
THIS SECTION TESTS THE EFFECT OF PRINTING EXPRESSIONS WHICH                     
CAUSE NON-FATAL EXCEPTIONS.                                                     
                                                                                
TO PASS THIS TEST:                                                              
                                                                                
    1) FOUR EXCEPTIONS MUST BE REPORTED; OVERFLOW, DIVISION                     
       BY ZERO, ZERO RAISED TO A NEGATIVE POWER, AND                            
       OVERFLOW OF EXP FUNCTION, AND                                            
                                                                                
    2) NEGATIVE, NEGATIVE, POSITIVE, AND POSITIVE MACHINE                       
       INFINITY MUST BE SUPPLIED AS THE VALUES OF THE                           
       EXPRESSIONS AND THEN PRINTED.                                            
                                                                                
                   BEGIN TEST.                                                  
                                                                                
ABOUT TO EXECUTE:                                                               
   PRINT (-1E-33) ^ (-3333), (-1E-33) / 0, 0 ^ (-1E-33), EXP(1E20)              
                                                                                
*** Arithmetic Overflow ***                                                     
-1.79769E+308  *** WARNING:  Divide by 0 ***                                    
-1.79769E+308  *** Arithmetic Overflow ***                                      
 1.79769E+308  *** Arithmetic Overflow ***                                      
 1.79769E+308                                                                   
                                                                                
IF FOUR EXCEPTIONS REPORTED AND NEGATIVE, NEGATIVE,                             
   POSITIVE, AND POSITIVE INFINITY PRINTED, THEN                                
*** TEST PASSED ***                                                             
                                                                                
                    END TEST.                                                   
                                                                                
SECTION 174.2: EXCEPTIONAL EXPRESSIONS AS TAB-ITEMS.                            
                                                                                
THIS SECTION TESTS THE EFFECT OF OVERFLOW IN A TAB-ITEM.                        
                                                                                
TO PASS THIS TEST:                                                              
                                                                                
    1) THE OVERFLOW EXCEPTION MUST BE REPORTED, AND                             
                                                                                
    2) EXECUTION CONTINUES, WITH THE TAB EVALUATING TO                          
       SOME ARBITRARY PRINT POSITION.                                           
                                                                                
                    BEGIN TEST.                                                 
                                                                                
ABOUT TO EXECUTE:                                                               
   PRINT TAB(9^(9^9));X$                                                        
   (WHERE X$ = 'X')                                                             
                                                                                
000000000111111111122222222223333333333444444444455555555556666666666777        
123456789012345678901234567890123456789012345678901234567890123456789012        
*** Arithmetic Overflow ***                                                     
*** WARNING: INVALID TAB() ***                                                  
X                                                                               
                                                                                
IF OVERFLOW EXCEPTION REPORTED, AND 'X' APPEARED FOLLOWING                      
   NUMBERED LINES, THEN                                                         
*** TEST PASSED ***                                                             
                                                                                
                    END TEST.                                                   
                                                                                
END PROGRAM 174                                                                 
