如果所有位均为0,什么是IEEE浮点的价值? [英] If all bits are 0, what is the value of IEEE floating point?
问题描述
如果所有位均为0(例如I memset的
浮点变量全部为0),什么是GCC使用IEEE浮点的价值?它是保证0.0?
If all bits are 0 (example I memset
the floating point variable to all 0), what is the value of IEEE floating point used in gcc? It is guaranteed to be 0.0 ?
我想其他浮点格式的结果可能会有所不同。但我的问题是具体到用gcc使用IEEE浮点。
I guess for other floating point formats result may vary. But my question is specific to IEEE floating point used with gcc.
推荐答案
如果实现是符合IEEE 754的存在特殊的情况下对不同的比特组合,例如记录的here 。
If the implementation is IEEE 754 compliant there exist special cases for different bit-combinations, like documented here.
有关你的情况:当所有位(符号,指数,尾数)为零的浮点值重新presents也为零,由IEEE 754定义
For your case: When all bits (sign, exponent, mantissa) are zero the floating point value represents also zero, as defined by IEEE 754.
这篇关于如果所有位均为0,什么是IEEE浮点的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!