http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994

--- Comment #7 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
An example of MPC not following all the Annex G special cases is that 
catanh (1 + i0) is specified in Annex G to return Inf + i0 with 
divide-by-zero exception, but at least with my MPC installation it returns 
Inf + iNaN.  I haven't tried to check how MPFR handles special cases; the 
issue with MPC is simply something I noticed incidentally while fixing 
glibc libm handling of various <complex.h> functions.

> I was wondering about that last point. Couldn't we replace:
> 
> x=sin(Inf);
> 
> with:
> 
> x=NaN;
> errno=EDOM; // only if flag_math_errno

errno is typically a macro....

> volatile double f=NaN+NaN; // if flag_trapping_math, something to raise 
> invalid
> (make sure we don't recursively try to propagate the constant there, so maybe
> the NaN argument should be volatile)

I think you mean 0.0 / 0.0 or Inf - Inf or similar; NaN+NaN doesn't raise 
an exception if the NaNs are quiet NaNs.

Reply via email to