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

display of linspace with BigFloat argument throws #22380

Closed
mzaffalon opened this issue Jun 15, 2017 · 6 comments
Closed

display of linspace with BigFloat argument throws #22380

mzaffalon opened this issue Jun 15, 2017 · 6 comments
Labels
domain:bignums BigInt and BigFloat domain:display and printing Aesthetics and correctness of printed representations of objects.

Comments

@mzaffalon
Copy link
Contributor

On Julia 0.5.2, the REPL cannot display linspace with BigFloat argument.

julia> linspace(big(-1), big(1), 11)
Error showing value of type LinSpace{BigFloat}:
ERROR: MethodError: no method matching dims2string(::Tuple{BigInt})
Closest candidates are:
  dims2string(::Tuple{Vararg{Int64,N}}) at show.jl:1481
 in _summary(::LinSpace{BigFloat}, ::Tuple{Base.OneTo{BigInt}}) at .\show.jl:1489
 in summary(::LinSpace{BigFloat}) at .\show.jl:1488
 in show(::IOContext{Base.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::LinSpace{BigFloat}) at .\replutil.jl:138
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::LinSpace{BigFloat}) at .\REPL.jl:132
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::LinSpace{BigFloat}) at .\REPL.jl:135
 in display(::LinSpace{BigFloat}) at .\multimedia.jl:143
 in print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at .\REPL.jl:154
 in print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at .\REPL.jl:139
 in (::Base.REPL.##22#23{Bool,Base.REPL.##33#42{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at .\REPL.jl:652
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at .\LineEdit.jl:1579
 in run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at .\REPL.jl:903
 in run_repl(::Base.REPL.LineEditREPL, ::Base.##952#953) at .\REPL.jl:188
 in _start() at .\client.jl:363

julia> collect(linspace(big(-1), big(1), 11))
11-element Array{BigFloat,1}:
 -1.000000000000000000000000000000000000000000000000000000000000000000000000000000
 -8.000000000000000000000000000000000000000000000000000000000000000000000000000017e-01
 -6.000000000000000000000000000000000000000000000000000000000000000000000000000035e-01
 -4.000000000000000000000000000000000000000000000000000000000000000000000000000009e-01
 -2.000000000000000000000000000000000000000000000000000000000000000000000000000004e-01
  0.000000000000000000000000000000000000000000000000000000000000000000000000000000
  2.000000000000000000000000000000000000000000000000000000000000000000000000000004e-01
  4.000000000000000000000000000000000000000000000000000000000000000000000000000009e-01
  6.000000000000000000000000000000000000000000000000000000000000000000000000000035e-01
  8.000000000000000000000000000000000000000000000000000000000000000000000000000017e-01
  1.000000000000000000000000000000000000000000000000000000000000000000000000000000
@KristofferC
Copy link
Sponsor Member

Works on 0.6-rc3

@stevengj
Copy link
Member

Maybe was fixed by #18777?

@mzaffalon
Copy link
Contributor Author

@stevengj It is only the printing at the REPL that does not work.

@ararslan ararslan added domain:bignums BigInt and BigFloat domain:display and printing Aesthetics and correctness of printed representations of objects. labels Jun 15, 2017
@stevengj
Copy link
Member

@mzaffalon, it was #18777 that changed immutable LinSpace{T} from using len::T to len::Int. The display problem above seems to be related to the old behavior of LinSpace{BigFloat} using a BigFloat length (len) rather than an Int length.

@rfourquet
Copy link
Member

Can this be closed? Otherwise the problem should be restated and the title changed.

@stevengj
Copy link
Member

I think this can be closed now. The analogous type in 1.0 seems to display fine:

julia> range(big(-1), stop=big(1), length=11)
11-element LinRange{BigFloat}:
 -1.0,-8.0e-01,-6.0e-01,-4.0e-01,,2.0e-01,4.0e-01,6.0e-01,8.0e-01,1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:bignums BigInt and BigFloat domain:display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

5 participants