- if (ix == 0) { /* x == 0 */
- SET_FLOAT_WORD(x, (hy&0x80000000)|1); /* return +-minsubnormal */
- /* raise underflow flag */
- t = x*x;
- if (t == x)
- return t;
- return x;
- }
- if (hx >= 0) { /* x > 0 */
- if (hx > hy) { /* x > y, x -= ulp */
- hx--;
- } else { /* x < y, x += ulp */
- hx++;
- }
- } else { /* x < 0 */
- if (hy >= 0 || hx > hy) { /* x < y, x -= ulp */
- hx--;
- } else { /* x > y, x += ulp */
- hx++;
- }
- }
- hy = hx & 0x7f800000;
- if (hy >= 0x7f800000) /* overflow */
- return x+x;
- if (hy < 0x00800000) { /* underflow */
- /* raise underflow flag */
- t = x*x;
- if (t != x) {
- SET_FLOAT_WORD(y, hx);