如何计算 IEEE 扩展双精度的最小值和最大值?
我知道最小值和值为:
分钟:3.362...10-4932
最大值:1.189... 10+4932
和 (2^14) * log(2) ~ 4932
这给了我指数部分。但我无法计算出尾数。
I know that the min and values are:
min:3.362... 10-4932
max:1.189... 10+4932
and (2^14) * log(2) ~ 4932
which gives me the exponential part. But I can't figure out mantissa.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尾数有一个隐含的开始位。这避免了为始终为 1 的位浪费一位存储空间(除了减少的浮点数,这是所有指数位都为零时的特殊情况)。
请注意,隐式第一位数字只能采用二进制。例如,在十进制中,您可能有 3.14e+2,并且您不能只删除第一个数字 (3),因为您不知道它是哪个数字(1-9)。
例如,浮点值 seeemmmmm 将被读为 (在 C 风格的伪代码中)
其中,bias 是该特定浮点类型的常量,因此所有指数值 (eee) 都可以为正,并且 000 是最负的指数,
因此,您可以通过 0b111111(1)计算最大值。比尾数多的位)移动了指数的最大值(无偏),最小值与负号相同。
Mantissa has an implicit beginning one bit. This avoids wasting one bit of storage for the bit which is always one (except for reduced floats, which are a special case when all exponent bits are zero).
Notice that the implicit first digit is only possible in binary. E.g. in decimal you might have 3.14e+2 and you cannot just drop the first digit (3) because you wouldn't know which number (1-9 it was anymore.
For example, a floating point value seeemmmmm would be read as (in C-style pseudo code)
Where bias is a constant for this particular floating-point type so that all exponent values (eee) can be positive and 000 is the most negative exponent.
So, you can calculate the maximum value by 0b111111 (one more bit than there is in the mantissa) shifted by the maximum value (unbiased) of the exponent. The minimum value is the same with a negative sign.