PROGRAM FILE 35: EXCEPTION - OVERFLOW AND UNDERFLOW WITHIN                      
        SUB-EXPRESSIONS                                                         
    ANSI STANDARD 7.4, 7.5                                                      
                                                                                
THIS PROGRAM TESTS THE EFFECT OF NUMERIC OVERFLOW AND                           
UNDERFLOW WITHIN A SUB-EXPRESSION ON THE CONTAINING                             
EXPRESSION.                                                                     
                                                                                
SECTION 35.1: SUB-EXPRESSION OVERFLOW                                           
                                                                                
THIS SECTION TESTS THE EFFECT ON AN EXPRESSION OF NUMERIC                       
OVERFLOW WITHIN ONE OF ITS SUB-EXPRESSIONS.                                     
                                                                                
TO PASS THIS TEST:                                                              
                                                                                
    1) A MESSAGE IDENTIFYING THE EXCEPTION MUST BE                              
       DISPLAYED, AND                                                           
                                                                                
    2) MACHINE INFINITY MUST BE SUPPLIED AS THE VALUE                           
       OF THE SUB-EXPRESSION.                                                   
                                                                                
               BEGIN TEST                                                       
                                                                                
ABOUT TO COMPUTE -.01 * (10 ^ 99999)                                            
*** Arithmetic Overflow ***                                                     
RESULT = -1.79769E+306                                                          
                                                                                
IF RESULT = (-.01 * MACHINE INFINITY)                                           
   AND OVERFLOW EXCEPTION REPORTED, THEN                                        
*** TEST PASSES *** OTHERWISE *** TEST FAILS ***                                
                                                                                
                END TEST                                                        
                                                                                
SECTION 35.2: SUB-EXPRESSION UNDERFLOW                                          
                                                                                
THIS SECTION TESTS THE EFFECT OF AN EXPRESSION OF NUMERIC                       
UNDERFLOW WITHIN ONE OF ITS OPERATIONS.                                         
                                                                                
TO PASS THIS TEST:                                                              
                                                                                
    1) A MESSAGE IDENTIFYING THE EXCEPTION MAY BE                               
       DISPLAYED (NOT MANDATORY), AND                                           
                                                                                
    2) ZERO MUST BE SUPPLIED AS THE VALUE                                       
       OF THE SUB-EXPRESSION.                                                   
                                                                                
               BEGIN TEST                                                       
                                                                                
ABOUT TO COMPUTE 3 + (10 ^ (-99999))                                            
RESULT =  3                                                                     
                                                                                
*** TEST PASSED ***                                                             
                                                                                
                END TEST                                                        
                                                                                
END PROGRAM 35                                                                  
