I know how computer today stores negative integers, which most of the computers use the 2' complement. I just wast wondering the 2' complement method applies for all kinds of numbers like floating points as well?
No, floating-points does not use 2 complement representation, but as all binary implementations have a sign bit, it is guaranteed that for all values (except NaNs where signs have no sense) the integer representation of a floating-point number can be tested with < 0. This is because integers in 2 complement are also negative if the first bit is set. But neither the significand nor the exponent use 2 complement representation.
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