2 ms·
Yes, this proposal does make things a lot easier because: twelveHour = twentyFourHour mod 12 But instead with the status quo, we need to add this extra line o
by nayuki 10y ago
Yes, this proposal does make things a lot easier because:
twelveHour = twentyFourHour mod 12
But instead with the status quo, we need to add this extra line of logic:
if twelveHour == 0 then twelveHour = 12
- colejohnson66 10y ago> But instead with the status quo, we need to add this extra line of logic: > if twelveHour == 0 then twelveHour = 12 That's because humans naturally begin counting from 1, not 0. Mainly because we are counting objects, not adding an array index to a pointer.
- fnj 10y agoTime is not a count. Time is a linear displacement, just like distance. As such, it only makes sense to start with 0. Did you ever see a ruler that starts with "1" at the very end? Of course not. It starts with "0", but they just don't bother to print the "0". One inch is a displacement of "1" from the beginning. One hour is a displacement of "1" from the beginning. It's pretty stupid to arbitrarily call the beginning "12".