5 ms·
Incidentally, this is why UNIX uses zero for "success" and nonzero for errors.
by noahlt 7y ago
Incidentally, this is why UNIX uses zero for "success" and nonzero for errors.
- phkahler 7y agoZero is not an indicator of success. It is a lack of failure (NULL). That distinction is why some people think the "flag" is inverted.
- reallydude 7y agoAs per the principle, the lack of failure is how success can be measured. ie Consequently, a successful endeavor (subject to this principle) is one where every possible deficiency has been avoided.
- jacquesm 7y agoI always took this to be 'there is only one success, there are many failures', there is only one zero, but many values other than zero. It seemed kind of logical.
- TheRealSteel 7y agoThere is only one of any number.
- jacquesm 7y agoThat is true, in the pedantic sense but zero has many properties that other numbers do not.
- cgriswald 7y agoThis seems apropos: https://en.wikipedia.org/wiki/Interesting_number_paradox https://en.wikipedia.org/wiki/Interesting_number_paradox
- j1vms 7y ago> zero has many properties that other numbers do not In particular, zero is the additive identity [0] in almost all the "usual" number systems in which it appears. That is roughly speaking, it is the only A such that X + A = X, for all X, where X and A are elements of the number system (e.g. field of real/complex numbers). [0] https://en.wikipedia.org/wiki/Additive_identity https://en.wikipedia.org/wiki/Additive_identity
- jakobegger 7y agoIt's also the only real number that does not have an inverse element for multiplication (there is no number b such that (a * 0) * b = a)
- james_s_tayler 7y agoThe integers form a group under multiplication though and a key property of a group is that every element has an inverse. So how does the definition hold if there is nothing that could be considered an inverse for the number 0? Curious about this... I never thought about it before.
- ulrikrasmussen 7y agoYou are thinking of the multiplicative group of integers coprime to some integer n. That set by definition never includes 0.
- jacobolus 7y agoThe integers do not form a group under multiplication. As you noticed, the multiplicative inverse of any integer other than 1 or –1 is not an integer. You might be thinking of the rational numbers (excluding zero).
- james_s_tayler 7y agoWoops. You're right. Looks like I need to play Group or Not Group. https://youtu.be/qvx9TnK85bw https://youtu.be/qvx9TnK85bw But then even for addition what's the inverse of 0? -0?
- xondono 7y agoBut all of them evaluate to true except for zero, thus one code for success, many for failure
- cgriswald 7y agoThat's idiomatic, not an inherent property of the numbers themselves. You're basically arguing that because we do it in one context we do it in another context, but it doesn't answer the question of why.
- falcor84 7y agoWell, an interesting fact is that every nonzero rational number has two equal representations in some bases, e.g. 0.999...=1. Zero is then is the only rational number with just one representation. https://en.wikipedia.org/wiki/0.999.. https://en.wikipedia.org/wiki/0.999...
- dorgo 7y agoähmm, no? Counterexample: 1/3 >every nonzero TERMINATING decimal has two equal representations
- falcor84 7y agoI mentioned "in some bases". In base 3, it's 0.1 and 0.0222...
- cgriswald 7y agoYou can represent 0 a countably infinite number of ways: 0 0.0 0.00 0.000 0.0000 ...
- falcor84 7y agoWell, the convention in maths is that we never add trailing zeros, since they wouldn't as any information. Unlike in other sciences, where they represent measurement precision.
- cgriswald 7y agoThe same is true of .999... and 1. In any case, it’s an artifact of how we represent numbers, not an property of the numbers themselves.