Fix sin, cos, tan in non-default rounding modes (bug 3976)

Joseph S. Myers joseph@codesourcery.com
Fri Mar 2 18:29:00 GMT 2012


On Fri, 2 Mar 2012, Andreas Jaeger wrote:

> > @@ -343,9 +360,13 @@ __sin(double x){
> >   	else {
> >   	  if (k == 0x7ff00000&&  u.i[LOW_HALF] == 0)
> >   	    __set_errno (EDOM);
> > -	  return x / x;
> > +	  retval = x / x;
> > +	  goto ret;
> 
> I suggest to remove the goto ret.

I think this code is clearer with goto ret used in each case including 
this one; it keeps the pattern consistent throughout the function and 
means that if the code gets rearranged and this bit of code moved then 
there's no need to add a goto ret in one place as part of the 
rearrangement.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list