IEEE 浮点标准中指数和尾数大小的基本原理是什么?
我对浮点的工作原理有很好的了解,但我想知道具体的指数和尾数大小是如何决定的。它们在某种程度上是最优的吗?如何衡量浮点表示的最优性(我假设有多种方法)?我想这些问题在官方标准中得到了解决,但我无权访问它。
I have a decent understanding of how floating point works, but I want to know how the specific exponent and mantissa sizes were decided upon. Are they optimal in some way? How can optimality be measured for floating point representations (I assume there are several ways)? I imagine these issues are addressed in the official standard, but I don't have access to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 对 Will Kahan 的采访,他们基于 <该时代的 href="http://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm" rel="nofollow">VAX F 和 G 格式。
当然,这并不能回答如何选择这些格式的问题......
According to this interview with Will Kahan, they were based on the VAX F and G formats of the era.
Of course that doesn't answer the question of how those formats were chosen...
对于 32 位 IEEE 浮点数,其原因是精度应至少与 24 位定点一样好。
我不知道为什么是 24 位,但这似乎是一个合理的权衡。
我认为拥有一个像这样的漂亮“整数”(尾数 + 符号 = 3 字节,指数 = 1 字节)也可以使实现更加高效。
For 32-bit IEEE floats, the reasoning is that the precision should be at least as good as 24 bits fixed point.
Why exactly 24 bits, I don't know, but it seems like a reasonable tradeoff.
I suppose having a nice "round" number like that (mantissa + sign = 3 bytes, exponent = 1 byte) can also make implementations more efficient.