Print this page
11175 libm should use signbit() correctly
11188 c99 math macros should return strictly backward compatible values

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/__rem_pio2l.c
          +++ new/usr/src/lib/libm/common/LD/__rem_pio2l.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30      -/* __rem_pio2l(x,y)
       30 +/*
       31 + * __rem_pio2l(x,y)
  31   32   *
  32   33   * return the remainder of x rem pi/2 in y[0]+y[1]
  33   34   * by calling __rem_pio2m
  34   35   */
  35   36  
  36   37  #include "libm.h"
  37   38  #include "longdouble.h"
  38   39  
  39   40  extern const int _TBL_ipio2l_inf[];
  40   41  
↓ open down ↓ 22 lines elided ↑ open up ↑
  63   64                  z = (z - (long double)t[i]) * two24l;
  64   65          }
  65   66          nx = 3;
  66   67          while (t[nx-1] == 0.0)
  67   68                  nx--;   /* omit trailing zeros */
  68   69          n = __rem_pio2m(t, v, e0, nx, 2, _TBL_ipio2l_inf);
  69   70          z = (long double)v[1];
  70   71          w = (long double)v[0];
  71   72          y[0] = z + w;
  72   73          y[1] = z - (y[0] - w);
  73      -        if (sign == 1) {
       74 +        if (sign != 0) {
  74   75                  y[0] = -y[0];
  75   76                  y[1] = -y[1];
  76   77                  return (-n);
  77   78          }
  78   79          return (n);
  79   80  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX