浮点数:“前导1在有效位数上是'隐含的'." -...嗯? [英] Floating-point: "The leading 1 is 'implicit' in the significand." -- ...huh?

查看:186
本文介绍了浮点数:“前导1在有效位数上是'隐含的'." -...嗯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习有关浮点IEEE 754数字的表示形式,我的教科书上说:

I'm learning about the representation of floating-point IEEE 754 numbers, and my textbook says:

要把更多的位包装到有效位数中,IEEE 754会将标准化的二进制数的前1位隐含起来.因此,该数字实际上单精度为24位长(分别表示1和23位小数),而双精度则为53位长(1 + 52).

To pack even more bits into the significand, IEEE 754 makes the leading 1-bit of normalized binary numbers implicit. Hence, the number is actually 24 bits long in single precision (implied 1 and 23-bit fraction), and 53 bits long in double precision (1 + 52).

我在这里不明白隐式"是什么意思……显式位和隐式位之间有什么区别?并非所有数字都具有该位,而不论其符号是什么?

I don't get what "implicit" means here... what's the difference between an explicit bit and an implicit bit? Don't all numbers have the bit, regardless of their sign?

推荐答案

是的,所有归一化的数字(零除外)都将该位设置为一个(a),因此它们使其隐式以防止浪费存储空间.

Yes, all normalised numbers (other than the zeroes) have that bit set to one (a), so they make it implicit to prevent wasting space storing it.

换句话说,他们完全保存了该位,然后重新使用它,以便可以使用它来提高数字的精度.

In other words, they save that bit totally, and reuse it so that it can be used to increase the precision of your numbers.

请记住,这是分数的第一位,而不是二进制模式的第一位.二进制模式的第一位是符号,其后是几位指数,其后是小数本身.

Keep in mind that this is the first bit of the fraction, not the first bit of the binary pattern. The first bit of the binary pattern is the sign, followed by a few bits of exponent, followed by the fraction itself.

例如,单个精度数字是(符号,指数,分数):

For example, a single precision number is (sign, exponent, fraction):

<1>  <--8--->  <---------23---------->  <- bit widths
 s   eeeeeeee  fffffffffffffffffffffff

如果您看一下数字的计算方式,那就是:

If you look at the way the number is calculated, it's:

(-1)sign x 1.fraction x 2exponent-bias

(-1)sign x 1.fraction x 2exponent-bias

因此用于计算该值的小数部分是1.fffff...fff(以二进制形式).

So the fractional part used for calculating that value is 1.fffff...fff (in binary).

(a)实际上存在一类数字(非规范化的数字和零),其属性不成立.这些数字都有一个零的有偏指数,但是绝大多数数字都遵循规则.

(a) There is actually a class of numbers (the denormalised ones and the zeroes) for which that property does not hold true. These numbers all have a biased exponent of zero but the vast majority of numbers follow the rule.

这篇关于浮点数:“前导1在有效位数上是'隐含的'." -...嗯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆