On Thu, 26 May 2011, William J. Schmidt wrote:

> +  /* Optimize pow(x,1./3.) = cbrt(x).  This is always safe.  */

No, it's not always safe.  1./3. isn't exactly representable; if x is 
negative (and finite), the correct value of the LHS is a NaN (with the 
"invalid" exception raised) because the value of 1./3. actually has an 
even denominator, whereas the correct value of the RHS is a negative real 
value.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to