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 ?
I guess for other floating point formats result may vary. But my question is specific to IEEE floating point used with gcc.
In addition, there is a floating-point zero; depending on the implementation, there may also be a ``minus zero. '' If there is no minus zero, then 0.0 and -0.0 are both interpreted as simply a floating-point zero.
0 represents a positive number while 1 represents a negative number.
The most commonly used floating point standard is the IEEE standard. According to this standard, floating point numbers are represented with 32 bits (single precision) or 64 bits (double precision).
The values +infinity and -infinity are denoted with an exponent of all ones and a mantissa of all zeros. The sign bit distinguishes between negative infinity and positive infinity.
If the implementation is IEEE 754 compliant there exist special cases for different bit-combinations, like documented here.
For your case: When all bits (sign, exponent, mantissa) are zero the floating point value represents also zero, as defined by IEEE 754.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With