-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
set_bigfloat_precision behaves odd (or BigFloat display) #11565
Comments
This is because of the way The MPFR library doesn't make it easy to find out how many decimal places are needed to read back the number exactly at a given precision (at least this is not clear to me). Playing around with MPFR, I found heuristically, that this number of digits for a lot of precision values ( To figure out something like this was proposed before by @dpsanders |
I'm not an expert of MPFR. Yet, apart from the info about the precision (which is pleasant to make it disappear), I think the current output of version 0.3.x is nicer: julia> VERSION
v"0.3.9"
julia> get_bigfloat_precision()
256
julia> BigFloat("1.1")
1.100000000000000000000000000000000000000000000000000000000000000000000000000003e+00 with 256 bits of precision
julia> set_bigfloat_precision(40)
40
julia> BigFloat("1.1")
1.1000000000004e+00 with 40 bits of precision Regarding the number of displayed digits, I think it is related to the actual number of bits used. For |
Agree – the number of digits printed should depend on the precision of the BigFloat. |
@lbenet I see, It makes sense, as OK, I can submit again a PR with these changes. Would that be all right @StefanKarpinski ? |
Thanks for taking care of this. |
Something odd may be happening with
set_bigfloat_precision
, or possibly with the wayBigFloat
s are displayed.Consider the following:
In the last line I was expecting something like 1.1000000000004e+00, since it mimics the last example (of the arbitrary precision section) of the documentation. But I can't actually reproduce it:
The text was updated successfully, but these errors were encountered: