Talk:Signedness

Are half the possible values negative?
<< roughly half the possible values are negative values

would it be better (or indeed correct?) to say:

<< half the possible values are non-positive values

?

Tomscambler (talk) 16:35, 15 January 2009 (UTC)


 * Actually, that would be wrong because exactly half of the possible values are negative values. E.g. for an 8 bit int, the range is -128 to +127. That's 128 negative, 1 zero and only 127 positive. 24.250.20.177 (talk) 02:34, 2 September 2015 (UTC)
 * As of this writing:
 * This topic relates to the second paragraph of the entry.
 * looks like the paragraph has been updated to include both contributors comments.
 * 5.102.213.85 (talk) 13:33, 31 December 2015 (UTC)

garbage value?
"Lets take an example in C. unsigned x=-1; printf("%u",x); The output is garbage value."

The output is not a garbage value. Garbage is what's left in a declared, uninitialized location. The output here is predictable, it should be 65,553, assuming x is a 16 bit word/char and the compiler typecasts (if it doesn't, it wouldn't compile that anyway). Speaking of which, unsigned can't be applied like that, not without a variable type (another reason that wouldn't compile). Also.. this article should maybe explain how signed binary works, and why it's most efficient for common instruction sets. LieAfterLie (talk) 07:07, 30 September 2010 (UTC)

NFC g guy yu
Constant teen 2600:100C:B04A:F440:5D37:C13A:BA20:6B12 (talk) 06:06, 30 November 2022 (UTC)