pow( -INFINITY, 0.5 )

Fred Tydeman uunet!ibmpa.awdpa.ibm.com!tydeman
Sat Aug 28 08:59:35 PDT 1993


Subject: pow( -INFINITY, 0.5 )                                                  
                                                                                
X3J11.1/93-028, the latest draft of the Floating-Point C Extensions,            
has on page 74 in section F.4.3 The pow function, several rules for             
exceptional cases.  Lines 5, 6, 7, 8 and 12-13 are:                             
  pow(-INFINITY, y) returns -INFINITY for y an odd integer > 0.                 
  pow(-INFINITY, y) returns +INFINITY for y > 0 and not an odd integer.         
  pow(-INFINITY, y) returns -0 for y an odd integer < 0.                        
  pow(-INFINITY, y) returns +0 for y < 0 and not an odd integer.                
  pow(x, y) returns a NaN and raises the invalid exception for finite           
    x < 0 and finite nonintegral y.                                             
                                                                                
Consider the case pow( -INFINITY, 0.5 );                                        
I believe that this should be the same as sqrt( -INFINITY );                    
IEEE-754 requires that sqrt( -INFINITY ) signal the invalid operation           
exception, which, in a non-trapping mode, return a quiet NaN.                   
                                                                                
Consider the case pow( -INFINITY, -0.5 );                                       
I believe that this should be the same as 1.0/sqrt( -INFINITY );                
So this should be 1.0 / NaN, which is a NaN.                                    
                                                                                
I believe that the five rules should be:                                        
  pow(-INFINITY, y) returns -INFINITY for y an odd integer > 0.                 
  pow(-INFINITY, y) returns +INFINITY for y an even integer > 0.                
  pow(-INFINITY, y) returns -0 for y an odd integer < 0.                        
  pow(-INFINITY, y) returns +0 for y an even integer < 0.                       
  pow(x, y) returns a NaN and raises the invalid exception for                  
    x < 0 and finite nonintegral y.                                             
                                                                                
These are not IBM's views, these are the personal ones of:                      
Fred Tydeman, IBM, Austin, Texas (512) 838-3322; fax (512) 838-3484             
AIX S/6000 Math library architect & IBM's rep to NCEG (X3J11.1)                 
Internet: tydemanaibmpa.awdpa.ibm.com    uucp: uunet!ibmsupt!tydeman            



More information about the Numeric-interest mailing list