incorrect promotion of rational types in eigvals etc #491
Closed
Description
opened on Dec 6, 2017
As pointed out on discourse, the eigvals
functions and a number of other linalg functions are incorrectly promoting rationals to Float32
rather than Float64
.
They are calling promote_type(Float32, typeof(one(T)/norm(one(T))))
. The Float32
was added by @andreasnoack in JuliaLang/julia#5526 to ensure that Float16
data was promoted to Float32
, and the norm
call was added by @andreasnoack in JuliaLang/julia#5652, at which point he changed norm(::Rational)
to produce a floating-point result. However, the norm(::Rational)
method was subsequently changed back to produce a rational result, at which point this bug was introduced.
A simple fix would be to add a float
call here (and in other functions that use this promotion scheme).
Metadata
Assignees
Labels
No labels
Activity