简体   繁体   中英

Does a subnormal number have an implicit 0?

我试图了解什么是次正规数,并且我想将指数固定在-127并使该数字变小,将隐式1替换为隐式0。听起来正确吗?

In the IEEE-754 basic 32-bit binary format, the exponent for a subnormal number is −126, not −127. The leading bit of the significand is indeed zero.

For any of the IEEE-754 binary formats, let:

  • p be the number of bits in the full significand (“p” for precision, 24 for the 32-bit format), bias be the bias used for encoding the exponent (127 for the 32-bit format), and
  • S be the bit in the sign field, E be the bits in the exponent field, and T be the bits in the trailing significand field.

If E is not all zeros or all ones, the value represented is a normal number. Its value is (−1) S •2 Ebias •(1+2 1− p •T). That term 1+2 1− p •T may be pictured as a one bit followed by a radix point followed by the bits of T : “1. T ”.

If E is all zeros, the value represented is zero (if T is zero) or a subnormal number. Its value is (−1) S •2 1− bias •(0+2 1− p •T). Note two changes from the normal value: The exponent is 1− bias instead of Ebias , and the leading bit is 0 instead of 1.

Note the smallest normal values and the subnormal values have an exponent of 1- bias , which is 1−127 = −126 for the 32-bit format. When transitioning from normal values to subnormal values, we do not change both the exponent and the leading bit, because that would cause a jump in the representable values. So the subnormal values have the same exponent as the smallest normal values; just the leading bit changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM