5 ms·
I think the 1-indexing folks would have to argue that a%b should return a value from 1 to b inclusive. This does make the same sort of intuitive sense as 1-inde
by OscarCunningham 4y ago
I think the 1-indexing folks would have to argue that a%b should return a value from 1 to b inclusive. This does make the same sort of intuitive sense as 1-indexing. For example we number clocks from 1 to 12.
- vore 4y ago% is defined as (mostly) a remainder operator. I don't think you want to change the semantics of division itself.
- OscarCunningham 4y agoRight. Ultimately the 1-indexers are wrong.
- black_knight 4y agoBut interestingly, the number at the top is 12, not 1.
- cryptonector 4y ago12 is zero, in 12-hour clocks.
- pvinis 4y agoNo we don't. Clocks start at 0. what time is it when it's half an hour after midnight? 00:30.
- chii 4y agobut nobody "says" zero o'clock - it's always twelve o'clock! and the example is in 24hr format - which needs to have the 00 to differentiate it from being 12:30. But if you write in 12hr format, you don't ever use 00 - it's always 12:30am or 12:30pm
- pvinis 4y agoFirst of all, you don't. Or I guess most Americans don't. I do, or most Europeans do. 12.30am and 12.30pm feels just very wrong in Europe. But yea, I do agree with you. we don't say 0, we say 12, no matter if it's noon or midnight. That's because we humans avoid saying zero when we mean zero. It's the same with other comments here, talking about counding seconds, we say "ok go, one, two,.. and not "zero, one, two,..". We say 3 months old baby, and not 0 years old baby. We use 0-index in so many things, we just avoid saying the word "zero", and we use other names or other units to avoid that word.
- lokedhs 4y agoI'm from Sweden, and I certainly would say 00:15 (as zero fifteen). Although the time at exactly 00:00 would be called midnight.