Question Details

No question body available.

Tags

x86 floating-point rounding underflow floating-point-exceptions

Answers (1)

January 9, 2026 Score: 3 Rep: 234,021 Quality: Medium Completeness: 30%

The rounding referred to in detection of underflow is only the rounding of the full-width significand, without considering the exponent, not the usual complete rounding of floating-point operations. IEEE-754 2019 7.5 states:

The underflow exception shall be signaled when a tiny non-zero result is detected. For binary formats, this shall be either:

a) after rounding — when a non-zero result computed as though the exponent range were unbounded would lie strictly between ± bemin, or

b) before rounding — when a non-zero result computed as though both the exponent range and the precision were unbounded would lie strictly between ± b emin.

Intel 64 and IA-32 Architectures Software Developer’s Manual, December 2017, 4.9.1.5 says (bold added):

The processor detects a potential floating-point numeric underflow condition whenever the result of rounding with unbounded exponent (taking into account precision control for x87) is non-zero and tiny; that is, non-zero and less than the smallest possible normalized, finite value that will fit into the destination operand…

You are multiplying 2−126 by 1 − 2−24. The real-number-arithmetic result of that is 2−126 − 2−150. If the exponent were unbounded, there would be no subnormal numbers, and the full 24-bit significand would be available. Thus, the result, 2−126 − 2−150 would be exactly representable, so rounding would not change it. This result is less than the smallest normal value of the destination. Therefore, underflow is detected.

When the complete rounding of the floating-point multiplication is performed, that 2−126 − 2−150 changes to 2−126. Observe this result is different from what you would have gotten if the exponent range were unbounded. This is the rationale for reporting underflow: You got a result that is different from what you would have gotten if the exponent range were unbounded. So the limit of the format is affecting the result, so underflow is reported.