book
book copied to clipboard
Change positive to nonnegative for unsigned int.
Out of curiosity, why this change?
0 is consider "positive" if you will (but is definitely not negative), so unsigned
is only positive numbers, including 0.
Out of curiosity, why this change?
0 is consider "positive" if you will (but is definitely not negative), so
unsigned
is only positive numbers, including 0.
Hi Matias. I think the number 0 being considered positive is confusing for many people including me. Nonnegative would be the mathematically precise way to describe a set of integers ranging from 0 to N where N is a positive integer.
I do not normally consider 0 a positive nor negative number however. However, I would not change the text from positive to non-negative even though I think non-negative is more technically correct because positive shows better contrast compared to negative used in the sentence preceding.
I do not normally consider 0 a positive nor negative number however. However, I would not change the text from positive to non-negative even though I think non-negative is more technically correct because positive shows better contrast compared to negative used in the sentence preceding.
c-git, you are correct in that 0 is not positive and it is not negative. Hence, my proposed patch to change the description from positive to non-negative because the set of unsigned integers is the set of integers {0, ..., 2ⁿ - 1} where n is the width of the integer. The set of positive integers has the least element as being 1 not 0, meaning 0 is not in this set. But that would not correctly describe the set of integers that can be represented by an unsigned integer.
I do not normally consider 0 a positive nor negative number however. However, I would not change the text from positive to non-negative even though I think non-negative is more technically correct because positive shows better contrast compared to negative used in the sentence preceding.
c-git, you are correct in that 0 is not positive and it is not negative. Hence, my proposed patch to change the description from positive to non-negative because the set of unsigned integers is the set of integers {0, ..., 2ⁿ - 1} where n is the width of the integer. The set of positive integers has the least element as being 1 not 0, meaning 0 is not in this set. But that would not correctly describe the set of integers that can be represented by an unsigned integer.
I do not have a last word or anything like that here, but I do think it is a superflous change, I think it adds no value at all so there is no need to change this. Remember that there is a printed version of this as a book, so changing superflous words to something else is just changing stuff between books versions...
I do still think positive
numbers is absolutely correct, and non-negative
will still be understood be everyone, but saying positive
numbers is easier than going to the negative non-negative
...