-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Rational powers and coversion #18114
Comments
Would you mind opening a pull request? |
pwl
added a commit
to pwl/julia
that referenced
this issue
Aug 18, 2016
pwl
added a commit
to pwl/julia
that referenced
this issue
Aug 18, 2016
simonbyrne
pushed a commit
that referenced
this issue
Aug 19, 2016
mfasi
pushed a commit
to mfasi/julia
that referenced
this issue
Sep 5, 2016
Fixes precision problem for rational powers of BigFloats (JuliaLang#18114)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is something wrong with
Rational
powers:where there shouldn't be any difference (
1//3
is of infinite precision). The issue comes from the definition of^
for rationals, where convert is applied to the result of a division of two integers, which is basically aFloat64
, the result is then converted back toBigFloat
Redefining
^
like thisfixes the problem:
In summary,
convert
doesn't commute with division (nor with other similar operations) andconvert
should be applied as early as possible (directly to the integers in this case) to avoid precision loss. There might be more cases like this that I am not aware of.EDIT: This bug is new in 0.5 and it was introduced in #17530.
The text was updated successfully, but these errors were encountered: