(values)
| 214 | |
| 215 | /** Mean of a list, or zero for an empty one. Never a division by nothing. */ |
| 216 | const mean = (values) => |
| 217 | values.length === 0 ? 0 : values.reduce((sum, value) => sum + value, 0) / values.length; |
| 218 | |
| 219 | /** Rounded to three places, so a report does not carry sixteen digits of noise. */ |
| 220 | const round = (value) => Math.round(value * 1000) / 1000; |