A sign-and-magnitude representation is a fixed-width binary representation in which one bit records the sign
and the remaining bits give the absolute
value of the represented integer. By convention,
the leading bit is 0 for a nonnegative value and 1 for a
negative value. With eight bits, for example, is represented by
and
by
.
For a word of bits, the representable integers
satisfy
. The strings
and
represent positive and negative zero,
respectively. arithmetic must treat the sign
separately from the magnitude.
The forms "sign and magnitude representation," "sign-magnitude representation," and "signed-magnitude representation" denote the same encoding. The first leaves the conjunction uncontracted, the second omits it, and the third uses the adjective "signed." Hyphens join the compound modifier in the entry title.