[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.4 and 1.9

version 1.4, 1994/03/03 17:04:27 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 <machine/endian.h>  #include "math_private.h"
   
 #if BYTE_ORDER == LITTLE_ENDIAN  
 #define n0      1  
 #else  
 #define n0      0  
 #endif  
   
 #ifdef __STDC__  #ifdef __STDC__
 static const double atanhi[] = {  static const double atanhi[] = {
Line 99  huge   = 1.0e300;
Line 94  huge   = 1.0e300;
 #endif  #endif
 {  {
         double w,s1,s2,z;          double w,s1,s2,z;
         int ix,hx,id;          int32_t ix,hx,id;
   
         hx = *(n0+(int*)&x);          GET_HIGH_WORD(hx,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.4  
changed lines
  Added in v.1.9

CVSweb <webmaster@jp.NetBSD.org>