简体   繁体   English

次普通数是否具有隐式0?

[英]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. 在IEEE-754基本的32位二进制格式中,次正规数的指数为-126,而不是-127。 The leading bit of the significand is indeed zero. 有效位的前导位确实为零。

For any of the IEEE-754 binary formats, let: 对于任何IEEE-754二进制格式,让:

  • 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 p是全有效位的位数(精度为“ p”,32位格式为24), bias是用于对指数进行编码的偏置(32位格式为127),并且
  • 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. S是符号字段中的位, E是指数字段中的位, T是尾随有效位字段中的位。

If E is not all zeros or all ones, the value represented is a normal number. 如果E不是全零或全零,则表示的值是一个正常数字。 Its value is (−1) S •2 Ebias •(1+2 1− p •T). 其值为(-1) S •2 E- 偏差 •(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. 该项1 + 2 1- p •T可以描绘为一个位,后跟一个小数点,后跟T的位:“ 1。 T ”. T ”。

If E is all zeros, the value represented is zero (if T is zero) or a subnormal number. 如果E全部为零,则表示的值为零(如果T为零)或次正规数。 Its value is (−1) S •2 1− bias •(0+2 1− p •T). 其值为(−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. 请注意,与正常值相比有两个变化:指数是1− bias而不是Ebias ,并且前导位是0而不是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. 请注意,最小法线值和次法线值的指数为1- bias ,对于32位格式,其为1-127 = -126。 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. 只是前导发生了变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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