Re:Why is zero plural? (2024)
by hyrix on Tuesday January 21, 2025 @09:04PM
(#42787955)
The answer is obviously because programmers want to be able to write
[ Parent
| on HN ]
Then they had best steer well clear of Poland.
> f"{n} result{'s' if n == 1 else ''}"
n>1 is even shorter than n!=1
(also you wrote == instead of != your code is backwards)
But the whole point is that "0 result" is not correct but "0 results" is.
The question is why is "0 results" correct. hyrix's answer is so that you have a simple equation for plural, my response is that if "0 result" was correct we would have an even simpler equation.
Re:Why is zero plural? (2024)
by DonHopkins on Wednesday January 22, 2025 @01:06AM
(#42789561)
That makes -infinity ... -1 singular too.