delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/09/16/12:41:29

Date: Wed, 16 Sep 1998 19:36:07 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: djgpp-workers AT delorie DOT com
cc: dj AT delorie DOT com
Subject: Patch for bug in e_atan2.c
Message-ID: <Pine.A32.3.91.980916193239.68818A-100000@ieva01.lanet.lv>
MIME-Version: 1.0

Hi!

Here is patch that fixes bug in src/libm/math/e_atan2.c
when atan2(anything,1.2) returns wrong result

Andris

---------------------------------------------------------
*** src/libm/math/e_atan2.c~    Sat Feb  7 13:25:04 1998
--- src/libm/math/e_atan2.c     Wed Sep 16 20:10:30 1998
***************
*** 73,79 ****
        if(((ix|((lx|-lx)>>31))>0x7ff00000)||
           ((iy|((ly|-ly)>>31))>0x7ff00000))    /* x or y is NaN */
           return x+y;
!       if((hx-(0x3ff00000|lx))==0) return atan(y);   /* x=1.0 */
        m = ((hy>>31)&1)|((hx>>30)&2);  /* 2*sign(x)+sign(y) */

      /* when y = 0 */
--- 73,79 ----
        if(((ix|((lx|-lx)>>31))>0x7ff00000)||
           ((iy|((ly|-ly)>>31))>0x7ff00000))    /* x or y is NaN */
           return x+y;
!       if(((hx-0x3ff00000)|lx)==0) return atan(y);   /* x=1.0 */
        m = ((hy>>31)&1)|((hx>>30)&2);  /* 2*sign(x)+sign(y) */

      /* when y = 0 */

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019