# Eigenvalues of matrices with rational entries

**URL:** <https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550>\
**Category:** General Usage\
**Created:** [December 5, 2017, 11:01pm UTC](https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550 "2017-12-05T23:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [December 5, 2017, 11:01pm UTC](https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550/1 "2017-12-05T23:01:49Z")

</div>

When I compute the eigenvalues of an `Array{Rational{Int64},2}`, I get Float32 values.

```
  julia> eigvals([1//2 1//4 1//4  
                  1//2 0 1//2  
                  1//4 1//4 1//2])
  3-element Array{Float32,1}:
    1.0 
    0.25
   -0.25

```

Why not Float64 values?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 6, 2017, 3:21am UTC](https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550/2 "2017-12-06T03:21:00Z")

</div>

Good catch, I think this is a bug. Looks like it was introduced a long time ago, as a consequence of #5526 (which added Float32 to the promotion to make things work for Float16) and #5652 (which changed the promotion criteria to use `norm`) and then a later change to the `norm` function that made `norm(::Rational)` return a `Rational`.

I filed an issue: [https://github.com/JuliaLang/julia/issues/24935](https://github.com/JuliaLang/julia/issues/24935)
