3 ms·
Round half up is the typical expectation for most people in rounding to the nearest whole value. It isn't displaying a "fake" time, it's rounding. https://en.
by mey 6y ago
Round half up is the typical expectation for most people in rounding to the nearest whole value.
It isn't displaying a "fake" time, it's rounding.
https://en.wikipedia.org/wiki/Rounding#Round_half_up https://en.wikipedia.org/wiki/Rounding#Round_half_up
Edit: Note, Round Half Up != Round half away from zero but that isn't important for this scenario :D
- notatoad 6y agoRound half up is a reasonable thing to do with many data types, but it's not something that's typically done with time. Any sensible time handling solution will truncate instead of rounding. Which is not to call apple's timer nonsensical. I agree with the author that it's a nicer experience, but I think it's likely an intentional decision to make the display look better, not a consequence of naive rounding.
- dingaling 6y ago> Any sensible time handling solution will truncate instead of rounding. That doesn't really work for a countdown timer though since the last second would then display as zero, which is nonsense for 'time remaining'. You have to round up, always. The Android 9 countdown works intuitively, it takes a second to decrement from 5 to 4 and sounds the alarm exactly at 0. You can't pause it at zero... > Which is not to call apple's timer nonsensical. It pretty much is, since the last 'second' takes more than a second to elapse.
- function_seven 6y agoI'll rewrite parent's statement to apply to timers and stopwatches: > Any sensible time handling solution will round off toward the starting value. So a stopwatch won't display "1" until a full second has elapsed, and will look like this for five seconds: "0...1...2...3...4...5!" A timer won't display "4" until a full second has elapsed, and will look like this: "5...4...3...2...1...0!" In the stopwatch case, the display shows "0" for 0.999 s; in the timer case it'll show "1" for 0.999 s.
- combatentropy 6y agoBut this highlights the difference between the two devices, stopwatches and timers. A stopwatch counts up. Therefore, it makes sense to use the floor (4.99 is still "4", not yet "5"). A timer counts down. Therefore, it makes sense to use the ceiling (3.01 is still "4", not yet "3"). In fact this was a turning point in the original article: "rounding down . . . makes a lot of sense when counting up. . . . But for a countdown timer, this is counterintuitive."
- function_seven 6y agoYup, that was my motivation for rewriting the parent statement. Abstracting away the type of counter and just saying, "show the number only when you crossed it" basically.
- combatentropy 6y agoSorry. First, I thought that you set out to contradict, rather than agree with, the person you replied to (since that is common). Then I was thrown off by your topic sentence, which seemed to lump together the two devices ("timers and stopwatches"). At this point, I think my reading accelerated to highway speeds and totally botched parsing the rest ;)
- jVinc 6y ago> Any sensible time handling solution will truncate instead of rounding. It's not a "handling of time" its just a display. And its extremely sensible to round to the nearest displayable number instead of rounding up or down, because this minimizes the error in the displayed number. And that's what you are interested in, conveying as accurately as possible what the current time is.
- dumpsterdiver 6y agoAgreed. This is a desktop widget display we're talking about here, not a log file entry.
- notatoad 6y agoAgain, I'm not trying to suggest anybody made a wrong choice here, just that they made an intentional decision. Theres no way this is happening because somebody called math.round() without thinking, you don't round time and the developers who make apple's clock app know that. They made a conscious decision to have the timer work this way. You can disagree with whether they made the right choice, but I'm pretty sure they thought about it.
- mey 6y agoConceptually you are attempting to display something that has more precision than you are willing to display. You can - Round (Truncation is a type of rounding, Rounding towards zero) - Adjust the display to increase the precision it displays - Do both by dynamically increasing the precision of the display/decreasing rounding as the distance to zero closes in.
- deleted 6y ago[deleted]