[BACK]Return to s_atan.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libm / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libm/src/s_atan.c between version 1.3 and 1.9

version 1.3, 1994/02/18 02:26:13 version 1.9, 1997/10/09 11:30:56
Line 10 
Line 10 
  * ====================================================   * ====================================================
  */   */
   
 #ifndef lint  #include <sys/cdefs.h>
 static char rcsid[] = "$Id$";  #if defined(LIBM_SCCS) && !defined(lint)
   __RCSID("$NetBSD$");
 #endif  #endif
   
 /* atan(x)  /* atan(x)
Line 34  static char rcsid[] = "$Id$";
Line 35  static char rcsid[] = "$Id$";
  * to produce the hexadecimal values shown.   * to produce the hexadecimal values shown.
  */   */
   
 #include <math.h>  #include "math.h"
   #include "math_private.h"
   
 #ifdef __STDC__  #ifdef __STDC__
 static const double atanhi[] = {  static const double atanhi[] = {
Line 92  huge   = 1.0e300;
Line 94  huge   = 1.0e300;
 #endif  #endif
 {  {
         double w,s1,s2,z;          double w,s1,s2,z;
         int n0,ix,hx,id;          int32_t ix,hx,id;
   
         n0 = ((*(int*)&one)>>29)^1;          GET_HIGH_WORD(hx,x);
         hx = *(n0+(int*)&x);  
         ix = hx&0x7fffffff;          ix = hx&0x7fffffff;
         if(ix>=0x44100000) {    /* if |x| >= 2^66 */          if(ix>=0x44100000) {    /* if |x| >= 2^66 */
               u_int32_t low;
               GET_LOW_WORD(low,x);
             if(ix>0x7ff00000||              if(ix>0x7ff00000||
                 (ix==0x7ff00000&&(*(1-n0+(int*)&x)!=0)))                  (ix==0x7ff00000&&(low!=0)))
                 return x+x;             /* NaN */                  return x+x;             /* NaN */
             if(hx>0) return  atanhi[3]+atanlo[3];              if(hx>0) return  atanhi[3]+atanlo[3];
             else     return -atanhi[3]-atanlo[3];              else     return -atanhi[3]-atanlo[3];

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.9

CVSweb <webmaster@jp.NetBSD.org>