I'm a little bit surprised that eig can return either real or complex 
results depending on the input values.

  julia> eig([1.0 0.0; 0.0 1.0])
  ([1.0,1.0],
  2x2 Array{Float64,2}:
   -1.0  -0.0
   -0.0   1.0)

  julia> eig([1.0 1.0; -1.0 1.0])
  ([1.0 + 1.0im,1.0 - 1.0im],
  2x2 Array{Complex{Float64},2}:
   0.707107+0.0im  0.707107-0.0im
   0.0+0.707107im  0.0-0.707107im)

Most other numerical functions in base have a return type that is a 
function of the argument types only, not argument values. Is there a reason 
eig is different?

Reply via email to