1.1 --- a/src/share/vm/runtime/sharedRuntimeTrans.cpp Wed Jul 28 17:57:43 2010 -0400 1.2 +++ b/src/share/vm/runtime/sharedRuntimeTrans.cpp Tue Aug 03 08:13:38 2010 -0400 1.3 @@ -572,7 +572,11 @@ 1.4 if(hy<0) z = one/z; /* z = (1/|x|) */ 1.5 if(hx<0) { 1.6 if(((ix-0x3ff00000)|yisint)==0) { 1.7 +#ifdef CAN_USE_NAN_DEFINE 1.8 + z = NAN; 1.9 +#else 1.10 z = (z-z)/(z-z); /* (-1)**non-int is NaN */ 1.11 +#endif 1.12 } else if(yisint==1) 1.13 z = -1.0*z; /* (x<0)**odd = -(|x|**odd) */ 1.14 } 1.15 @@ -583,7 +587,12 @@ 1.16 n = (hx>>31)+1; 1.17 1.18 /* (x<0)**(non-int) is NaN */ 1.19 - if((n|yisint)==0) return (x-x)/(x-x); 1.20 + if((n|yisint)==0) 1.21 +#ifdef CAN_USE_NAN_DEFINE 1.22 + return NAN; 1.23 +#else 1.24 + return (x-x)/(x-x); 1.25 +#endif 1.26 1.27 s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ 1.28 if((n|(yisint-1))==0) s = -one;/* (-ve)**(odd int) */