关于浮点数的implicit leading bit

dracularking 2013-04-04 09:20:51


http://en.wikipedia.org/wiki/Single-precision_floating-point_format

据维基载:
The true significand includes 23 fraction bits to the right of the binary point and an implicit leading bit (to the left of the binary point) with value 1 unless the exponent is stored with all zeros.

float都会有一个隐形的leading bit,但他说一般情况都有,除非exponent都存储了0,觉得有点不好理解,哪种浮点数会不需要leading bit呢?感觉都可以需要
...全文
217 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Drait 2014-11-09
  • 打赏
  • 举报
回复
意思是指数位(exponent bit)非零时,数值位或小数位(fraction bit)的实际值应该为其显示值(the value of fraction bits)加1(plus 1);用例子来说: num:3.0 十进制下的表示方式为 +2*(1+1/2) 二进制表示为 0-0000 0001-1000 0000 0000 0000 0000 000; 用十进制表示计算机二进制理解或表示3.0应为 2的1次幂即2 乘以(1+1/2)等于3,也就是+2*(1+1/2) = 3.0; num:1.1920928955078125e-7 十进制下的表示方式为 +1*(0+1/8388608); 二进制表示为 0-0000 0000-0000 0000 0000 0000 0000 001; 说明: 1- 1/8388608 是32位系统下所能表示的最小刻度值。 2- 只有当系统要表示小于2的-126次幂时即指数位全为0时,数值位(fraction bit)的实际值为其表示值.
dracularking 2013-04-05
  • 打赏
  • 举报
回复
准备揭帖了,顶者有分
dracularking 2013-04-05
  • 打赏
  • 举报
回复
i think it should be the meaning that only if there's exponent, the hidden bit could always be applied.

50,542

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧