Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect promotion of rational types in eigvals etc #491

Closed
stevengj opened this issue Dec 6, 2017 · 0 comments · Fixed by JuliaLang/julia#24936
Closed

incorrect promotion of rational types in eigvals etc #491

stevengj opened this issue Dec 6, 2017 · 0 comments · Fixed by JuliaLang/julia#24936

Comments

@stevengj
Copy link
Member

stevengj commented 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant