Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/m9x/fmaxf.c
          +++ new/usr/src/lib/libm/common/m9x/fmaxf.c
↓ open down ↓ 119 lines elided ↑ open up ↑
 120  120          unsigned s;
 121  121  
 122  122          /* if y is nan, replace it by x */
 123  123          if (y != y)
 124  124                  y = x;
 125  125  
 126  126          /* if x is nan, replace it by y */
 127  127          if (x != x)
 128  128                  x = y;
 129  129  
 130      -        /* if x is less than y or x and y are unordered, replace x by y */
 131      -#if defined(COMPARISON_MACRO_BUG)
 132      -        if (x < y)
 133      -#else
 134      -        if (!isgreaterequal(x, y))
 135      -#endif
      130 +        /* At this point, x and y are either both numeric, or both NaN */
      131 +        if (!isnan(x) && !isgreaterequal(x, y))
 136  132                  x = y;
 137  133  
 138  134          /*
 139      -         * now x and y are either both NaN or both numeric; clear the
 140      -         * sign of the result if either x or y has its sign clear
      135 +         * clear the sign of the result if either x or y has its sign clear
 141  136           */
 142  137          xx.f = x;
 143  138          yy.f = y;
 144  139          s = ~(xx.i & yy.i) & 0x80000000;
 145  140          xx.i &= ~s;
 146  141  
 147  142          return (xx.f);
 148  143  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX