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?
I know how computer today stores negative integers, which most of the computers use
Share
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.