23 ms·
Nitpick, but: > At its core, a file descriptor (often abbreviated as fd) is simply a positive integer A _non-negative_ integer.
by L3viathan 1y ago
Nitpick, but:
> At its core, a file descriptor (often abbreviated as fd) is simply a positive integer
A _non-negative_ integer.
- DougN7 1y agoOk, I have to ask: the difference between “positive” and “non-negative” is …?
- rkomorn 1y ago0 is non-negative but also... non-positive?
- bregma 1y agoThe difference is a classic off-by-one error that can lead to a security exploit.
- cesarb 1y agoThe integer numbers can be divided into "negative" (less than zero), zero, and "positive" (greater than zero). When one says "non-negative", they are excluding only the negative numbers, so zero is included; when one says "positive", zero is not included.
- magicalhippo 1y agoPositive numbers are greater than zero[1], while non-negative numbers are greater or equal to zero. [1]: https://en.wikipedia.org/wiki/List_of_types_of_numbers#Signed_numbers https://en.wikipedia.org/wiki/List_of_types_of_numbers#Signe...