简体   繁体   English

如果所有位都为0,那么IEEE浮点值是多少?

[英]If all bits are 0, what is the value of IEEE floating point?

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? 如果所有的位为0(例如,我memset浮点变量的所有0),什么是GCC使用IEEE浮点的值? It is guaranteed to be 0.0 ? 它保证是0.0?

I guess for other floating point formats result may vary. 我想其他浮点格式的结果可能会有所不同。 But my question is specific to IEEE floating point used with gcc. 但我的问题是特定于与gcc一起使用的IEEE浮点数。

If the implementation is IEEE 754 compliant there exist special cases for different bit-combinations, like documented here . 如果实现符合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. 对于您的情况:当所有位(符号,指数,尾数)为零时,浮点值也表示为零,如IEEE 754所定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM