[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about underflow detection



Hi,

I have a question about how the standard raises underflow and would
like to see if somehow can help on this.

Here are the two cases (single precision multiply) I am trying to
reslve (assuming both use round tie to even)
1. 80ffffff x bf000000
Assuming we have unlimited precision and unbound exponent, we actually have
1.111_1111_1111_1111_1111_1111 * 2 ^ {-126} x 1.0 * 2 ^ {-1} =
1.111_1111_1111_1111_1111_1111 * 2 ^{-127}
Because the unbiased exponent is -127, it cannot be fit in the IEEE
format, and we need to right shift the mantissa by one bit to get
0.111_1111_1111_1111_1111_1111_1 * 2 ^{-126}

After rounding, we have 1.0 * 2 ^ {-126}

2. 807fffff x bf800001
0.111_1111_1111_1111_1111_1111 * 2 ^{-126} x
1.000_0000_0000_0000_0000_0001 * 2^{0} =
0.111_1111_1111_1111_1111_1111_1111_..._1 * 2 ^{-126}
After rounding, we have 1.0 * 2 ^ {-126} as well.

In both cases, should the underflow flag be raised based on the standard?

Liang-Kai


754 | revision | FAQ | references | list archive