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 is converting to Float64 #178

Open
stevengj opened this issue Jan 20, 2024 · 1 comment · May be fixed by #180
Open

printf is converting to Float64 #178

stevengj opened this issue Jan 20, 2024 · 1 comment · May be fixed by #180
Labels

Comments

@stevengj
Copy link
Member

It looks like the @printf macro is broken — it seems to be converting values to Float64 before printing (reported on discourse):

julia> using DecFP, Printf

julia> x = rand(Dec128)
0.6498353664629435612857337361220566

julia> println(x)
0.6498353664629435612857337361220566

julia> @printf("%.36f", x)
0.649835366462943597731793943239608780
julia> 

julia> @printf("%.36f\n", Float64(x)) # matches @printf("%.36f", x) !!
0.649835366462943597731793943239608780

@jmkuhn, has @printf bitrotted? I thought it used to be working (after #48).

@stevengj stevengj added the bug label Jan 20, 2024
@jmkuhn jmkuhn linked a pull request Feb 22, 2024 that will close this issue
@jmkuhn
Copy link
Contributor

jmkuhn commented Feb 22, 2024

Yes, this worked correctly through Julia 1.5.x. It broke in Julia 1.6.0 with JuliaLang/julia#32859.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants