-
-
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
add base keyword to precision/setprecision #42428
Conversation
(Since we can't dispatch on the presence/absence of keyword arguments, this means that if external packages like Arblib or DoubleFloats or MultiFloats that want to support the new |
Unrelated CI error on freebsd64:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test case for setprecision
with a different base as well? Otherwise LGTM.
Co-authored-by: Simeon Schaub <[email protected]>
There's already a test: Or do you mean you want a test for another base besides |
This is just a convenience feature, but I got tired of telling students things like "let's do
setprecision(333)
, which corresponds to about 100 decimal digits". It's a lot easier to just do:and let Julia multiply by
log2(10)
for you.Given this, one also needs the corresponding
base
argument toprecision
, so that you can do e.g.and it will return
15
(the maximum number of decimal digits represented exactly by a 53-bit significand).