tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: signed overflow in atan2

    Date:        Wed, 7 Mar 2018 14:00:44 +0100
    From:        Joerg Sonnenberger <>
    Message-ID:  <>

  | This is a transformation typically done already.

I thought it might be with modern compilers - but it probably was not when 
atan2() was originally written,   But demonstrating that cannot hurt.

And if we want to be more sure then perhaps:

	if(((hx^0x3ff00000)|lx)==0) return atan(y);   /* x=1.0 */

would be a suitable replacement (probably formatted in a more KNF compat 


Home | Main Index | Thread Index | Old Index