在单精度IEEE-754中具有超过1个表示形式的所有实数 [英] All real numbers that have more than 1 representation in IEEE-754 of single precision

查看:109
本文介绍了在单精度IEEE-754中具有超过1个表示形式的所有实数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题如下:


写下所有具有大于1的单精度IEEE-754表示形式的实数。

Write down all the real numbers that have more than 1 representation in IEEE-754 of single precision.

现在,考虑到+0和-0不同,是否有任何数字具有该属性?

Now, considering +0 and -0 are different, are there any numbers that have this property?

推荐答案

没有。

IEEE754表示为 canonical ,这意味着所有数字都只有一个表示形式(如果有的话),而没有其他表示形式。

The IEEE754 representation is canonical, which means that all numbers have precisely one representation if any, and no others.

31                             0
seeeeeeeemmmmmmmmmmmmmmmmmmmmmmm

映射到

(-1)^ s * 2 ^(eeeeeeee-127)* 1.mmmmmmmmmmmmmmmmmmmmmmmmm(二进制)

(-1)^s * 2^(eeeeeeee - 127) * 1.mmmmmmmmmmmmmmmmmmmmmmm (binary)


  • 符号编码在符号位 s 。相同的实数的两个假定的不同表示形式必须具有相同的 s 值,因为只有该字段控制符号。

  • 1 位的最高有效位的位置(在十进制逗号左起的数字位置)以8位 eeeeeeee 指数位。相同的实数的两个假定的不同表示形式必须具有相同的 eeeeeeeeee 值,因为只有该字段控制最高1位的位置。

  • 最重要的 1 位正下方的23位编码为尾数( mmmm ... )。两个相同实数的推定不同表示形式必须具有相同的尾数值,因为只有该字段才控制紧接在最高有效 1 位以下的23位。实数。

  • The sign is encoded in the sign bit, s. Two putatively different representations of the same real number must have the same value of s, because only that field controls the sign.
  • The location of the most-significant 1-bit, in digit positions left from the decimal comma, is encoded in biased format in the eight eeeeeeee exponent bits. Two putatively different representations of the same real number must have the same value of eeeeeeee, because only that field controls the position of the most significant 1-bit.
  • The 23 bits immediately below the most-significant 1-bit are encoded in the mantissa (mmmm...). Two putatively different representations of the same real number would have to have the same mantissa value, because only that field controls the 23 bits immediately below the most-significant 1-bit of the real number.

结论是矛盾的。具有相同实数的两个假定不同的表示形式必须具有相同的符号,指数和尾数。换句话说,它们必须是相同的。

The conclusion is a contradiction. Two putatively different representations of a same real number would have to have the same sign, exponent and mantissa; In other words they must be identical.

此讨论忽略了所有特殊值,例如无穷,NaN和非正规数。

This discussion ignores all the special values, like infinities, NaNs and denormals.

这篇关于在单精度IEEE-754中具有超过1个表示形式的所有实数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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