LinearAlgebraX Result Output Format

Hi all,

I am trying LinearALgebraX package,

the result is quite funny, why there are //1 in all entries?
Capture d’écran_2022-07-23_15-02-57

How to discard all the //1? most people will be confused, unless you are already experienced with Julia and Linear Algebra.

That’s how Rational values are printed and that seems to be the main point of LinearAlgebraX:

This module implements basic linear algebra methods for matrices with exact entries (e.g., Rational{Int} values). The function names typically match the standard ones in Julia but with an x (for “exact”) appended.

I guess most people who don’t want those //1 will just use LinearAlgebra without the X :wink:

Anyways, you can always convert to Float with convert(Matrix{Float64}, rrefx(A)) or Float64.(rrefx(A)) - but that will lose the x factor :wink:

thanks a lot, I need LinearAlgebraX for its exact entries, just need to get rid of the //1

1 Like

If you need to just get rid of the //1, it is more appropriate to write your own Base.show method, instead of changing the output type.

See JuliaLang/julia#45396.

1 Like