Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/m9x/fminf.c
          +++ new/usr/src/lib/libm/common/m9x/fminf.c
↓ open down ↓ 78 lines elided ↑ open up ↑
  79   79          unsigned s;
  80   80  
  81   81          /* if y is nan, replace it by x */
  82   82          if (y != y)
  83   83                  y = x;
  84   84  
  85   85          /* if x is nan, replace it by y */
  86   86          if (x != x)
  87   87                  x = y;
  88   88  
  89      -/* if x is greater than y or x and y are unordered, replace x by y */
  90      -#if defined(COMPARISON_MACRO_BUG)
  91      -        if (x > y)
  92      -#else
  93      -        if (!islessequal(x, y))
  94      -#endif
       89 +        /* At this point, x and y are either both numeric, or both NaN */
       90 +        if (!isnan(x) && !islessequal(x, y))
  95   91                  x = y;
  96   92  
  97   93          /*
  98      -         * now x and y are either both NaN or both numeric; set the
  99      -         * sign of the result if either x or y has its sign set
       94 +         * set the sign of the result if either x or y has its sign set
 100   95           */
 101   96          xx.f = x;
 102   97          yy.f = y;
 103   98          s = (xx.i | yy.i) & 0x80000000;
 104   99          xx.i |= s;
 105  100  
 106  101          return (xx.f);
 107  102  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX