Talk:Averages/Mean time of day: Difference between revisions

Agree with doubt over prescribed method.
(→‎TCL and rounding: Things are very strange, but I'm not sure that they're wrong yet)
(Agree with doubt over prescribed method.)
 
(One intermediate revision by one other user not shown)
Line 22:
return '%02i:%02i:%02i' % (h, m, s)</lang>
--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:57, 2 July 2013 (UTC)
: Was a rounding issue; <tt>int()</tt> rounds to zero whereas <tt>round()</tt> rounds to nearest. –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 13:05, 28 August 2013 (UTC)
 
I'm not convinced that thewhole averaging usedmethodology is wrongcorrect in the first place. For example, when I try an alternative mechanism for time averaging (with times being either “pre” or “post” midnight so as to minimise the deltas):
<lang tcl>% set t [clock scan 23:00:17 -base 0]
79217
Line 37 ⟶ 38:
23:47:40</lang>
As you can see, I get a different answer (several seconds out) and that's using exact arithmetic. (You might get different intermediate values — they're local-timezone-dependant without the <tt>-gmt true</tt> option — but the final formatted result should be the same.) –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 12:59, 28 August 2013 (UTC)
 
:I agree. The mean of midnight - 3583 seconds, midnight - 1180 seconds, midnight + 765 seconds, and midnight + 1039 seconds is midnight - 739.75 seconds, or 23:47:40 to the nearest second. All the solutions so far — except for the JavaScript (which doesn't use the specified method) and the Scala (whose actual result isn't shown) — are claiming 23:47:43. --[[User:Nig|Nig]] ([[User talk:Nig|talk]]) 12:18, 4 April 2020 (UTC)
557

edits