I can’t find any reasonable solution to this seemingly simple issue. I want to make arrays of Float64 print with all their digits in the REPL. What method do I need to redefine for the array below to be printed with as many digits as the scalar?
See also https://github.com/JuliaLang/julia/issues/6493 … as I commented in that thread, it would be really trivial to implement a way to control the options passed by the REPL to its default IOContext, if we can just agree on the API.
Thanks for your answers! I was looking for a quick hack, to get many significant digits to copy into a unit test.
I often did use the format long command in matlab, so a simple, supported way of changing this at runtime would be highly appreciated!
This thread comes top when searching for “Julia display more digits in REPL”, but some of the suggestions are outdated. Likewise for the second-highest thread.
As of Julia 1.6, Base.Grisu was moved to the Grisu.jl package. This is mostly for backward-compatibility. I’d be grateful if you would share the Post-1.6 recommended approach to have more digits displayed in the REPL. And, as an extra, would be grateful if you would state whether the same method work for displaying digits inline. Thanks!
If you are saving floating-point data for use in other programs, I would think about using a standard file format, which should take care of the precision issue. e.g. HDF5.jl for a binary format (the most compact way to save at full precision), or CSV via DelimitedFiles.jl or CSV.jl, or JSON via JSON.jl, or …