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

Printf bug for BigInt #36031

Closed
simeonschaub opened this issue May 26, 2020 · 0 comments · Fixed by #36033
Closed

Printf bug for BigInt #36031

simeonschaub opened this issue May 26, 2020 · 0 comments · Fixed by #36033

Comments

@simeonschaub
Copy link
Member

The following fails on master, as well as 1.4:

julia> using Printf

julia> @printf "%.5e" big(10)
ERROR: MethodError: no method matching decode_dec(::BigInt)
Closest candidates are:
  decode_dec(::BigInt, ::Any) at /home/simeon/Documents/Julia/julia/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:932
  decode_dec(::Integer, ::Any) at /home/simeon/Documents/Julia/julia/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:892
  decode_dec(::Real, ::Any) at /home/simeon/Documents/Julia/julia/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:855
  ...
Stacktrace:
 [1] ini_dec(::BigInt, ::Int64, ::Array{UInt8,1}) at /home/simeon/Documents/Julia/julia/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:1062
 [2] ini_dec(::Base.TTY, ::BigInt, ::Int64, ::String, ::Int64, ::Int64, ::Char, ::Array{UInt8,1}) at /home/simeon/Documents/Julia/julia/usr/share/julia/stdlib/v1.6/Printf/src/Printf.jl:845
 [3] top-level scope at REPL[6]:1

It seems like decode_dec(::BigInt) calls a method that does not exist.

simeonschaub added a commit to simeonschaub/julia that referenced this issue May 26, 2020
simeonschaub added a commit to simeonschaub/julia that referenced this issue May 26, 2020
simonbyrne added a commit that referenced this issue May 27, 2020
Relative and octal printing used incorrect arguments. Fixes #36031.

Same as ddc65bb which was accidentally pushed to master, and reverted in adf6d52.
@mbauman mbauman reopened this May 27, 2020
simonbyrne added a commit that referenced this issue May 28, 2020
* fix #36031

* Apply suggestions from code review

Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
KristofferC pushed a commit that referenced this issue Jun 1, 2020
* fix #36031

* Apply suggestions from code review

Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
(cherry picked from commit 150311f)
simeonschaub pushed a commit to simeonschaub/julia that referenced this issue Aug 11, 2020
Relative and octal printing used incorrect arguments. Fixes JuliaLang#36031.
simeonschaub added a commit to simeonschaub/julia that referenced this issue Aug 11, 2020
* fix JuliaLang#36031

* Apply suggestions from code review

Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
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.

2 participants