- if ((ix|lx) == 0) { /* x == 0 */
- INSERT_WORDS(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 || (hx == hy && lx > ly)) { /* x > y, x -= ulp */
- if (lx == 0)
- hx--;
- lx--;
- } else { /* x < y, x += ulp */
- lx++;
- if (lx == 0)
- hx++;
- }
- } else { /* x < 0 */
- if (hy >= 0 || hx > hy || (hx == hy && lx > ly)) { /* x < y, x -= ulp */
- if (lx == 0)
- hx--;
- lx--;
- } else { /* x > y, x += ulp */
- lx++;
- if (lx == 0)
- hx++;
- }
- }
- hy = hx & 0x7ff00000;
- if (hy >= 0x7ff00000) /* overflow */
- return x+x;
- if (hy < 0x00100000) { /* underflow */
- /* raise underflow flag */
- t = x*x;
- if (t != x) {
- INSERT_WORDS(y, hx, lx);