HomeFreeBSD

ministat: disallow negative variance / nan Stddev

Description

ministat: disallow negative variance / nan Stddev

With all values identical it was possible for Var() to return a negative
value due to limited floating point precision, resulting in "nan"
reported as Stddev.

Variance cannot actually be negative, so just return 0. We can later
investigate alternate algorithms for calculating variance to reduce the
effect of catastrophic cancellation here.

Reported by: Arshan Khanifar <arshankhanifar_gmail.com>
Approved by: phk
Sponsored by: The FreeBSD Foundation

Details

Provenance
emasteAuthored on
Parents
rS329722: zdb: raise WARNS from 0 to 2
Branches
Unknown
Tags
Unknown