You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed today with Julia 0.5 that var(rand(Complex128, 100)) gives a complex result (e.g. 0.1877618197855592 + 0.0im) even though the result is always real-valued by definition.
Furthermore, the var(iterable) definition is wrong for complex values since it is missing the requisite complex conjugations: invoke(var, (Any,), rand(Complex128, 100)) gives a completely different (complex) result (e.g. 0.02791245510174357 + 0.008222495005184707im).
The former is suboptimal, but the latter is definitely a bug.
(And the frustrating thing is that I feel like I've fixed this before, somewhere in the Julia 0.1-0.2 timeframe. If so, my fault for not putting in a regression test.)
The text was updated successfully, but these errors were encountered:
I noticed today with Julia 0.5 that
var(rand(Complex128, 100))
gives a complex result (e.g.0.1877618197855592 + 0.0im
) even though the result is always real-valued by definition.Furthermore, the
var(iterable)
definition is wrong for complex values since it is missing the requisite complex conjugations:invoke(var, (Any,), rand(Complex128, 100))
gives a completely different (complex) result (e.g.0.02791245510174357 + 0.008222495005184707im
).The former is suboptimal, but the latter is definitely a bug.
(And the frustrating thing is that I feel like I've fixed this before, somewhere in the Julia 0.1-0.2 timeframe. If so, my fault for not putting in a regression test.)
The text was updated successfully, but these errors were encountered: