Timeline for C++ thread-safe averaging
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 24, 2018 at 14:22 | vote | accept | lunej.le | ||
Aug 24, 2018 at 5:59 | history | edited | user673679 | CC BY-SA 4.0 |
added 151 characters in body
|
Aug 24, 2018 at 5:50 | history | edited | user673679 | CC BY-SA 4.0 |
added 151 characters in body
|
Aug 23, 2018 at 16:54 | comment | added | yuri |
Prefer std::array over plain C-style arrays. Could you elaborate on this point? Maybe add reasons why? Seems a bit like cargo-cult otherwise.
|
|
Aug 23, 2018 at 9:44 | comment | added | Toby Speight |
Also, you might want to mention that the sum += loop can be written using std::accumulate() instead, before we dispense with it completely.
|
|
Aug 23, 2018 at 9:42 | comment | added | Toby Speight |
Actually, a cumulative mean can be updated with ++n; average += (x - average) / n; (fewer operations; less risk of exceeding range). (ref) (example)
|
|
Aug 23, 2018 at 8:36 | history | answered | user673679 | CC BY-SA 4.0 |