Closed CMGreenspon closed 1 year ago
The difference between the two is only at most the floating point round-off error, and is an inevitable part of computation in finite precision arithmetic. You can see the variation by something like
A = Float64[]
for i in 1:1000
temp = rand(100);
push!(A, NaNMath.mean(temp) - StatsBase.mean(temp))
end
[minimum(A), maximum(A)]
and compare this to eps()
.
Agreed with @jd-foster. It's unreasonable to expect exact equality in this case.
NaNMath.mean and StatsBase.mean do not produce the same result
This will evaluate to false. This seems to be true after digit 15:
round(mean(temp),digits=16) == round(NaNMath.mean(temp),digits=16)
Any idea why?