-
-
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
Refactor names of BigFloat precision functions #13232
Refactor names of BigFloat precision functions #13232
Conversation
I'm not really sold on One other thing I've been thinking about is that |
+1 to no underscores |
mutating a global fits with the "not safe to do from multiple threads" interpretation of the ! convention |
That's the first time I've heard of that multiple thread convention, is it documented somewhere? |
I think |
then, for consistency, should |
Yes, that too. |
I'm happy with |
I really dislike prefixing these with |
Agree with Stefan. I cringed when I just read getprecision and getrounding. On Tue, Oct 13, 2015 at 2:32 PM, Stefan Karpinski [email protected]
|
I also prefer without the |
Then |
set_rounding, | ||
with_rounding, | ||
setprecision, | ||
setprecision, |
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.
This line is a duplicate
Thanks for the detailed review, @ScottPJones |
Okay, I'm on board with |
Sure, should be able to this weekend. |
0d3e1b0
to
688deb4
Compare
After some git frustration, I have fixed @tkelman's comments (thanks!), squashed and rebased to current master. |
|
||
.. Docstring generated from Julia source | ||
|
||
Set the rounding mode of floating point type ``T``, controlling the |
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.
I think this needs one last run of genstdlib? Otherwise lgtm
I'm trying to get the docs fixed, but after several rounds of to-ing and fro-ing, I get
even though I don't see where there's a duplicate. |
Reduces the number of exported names from Base by 3 and makes them more flexible to me used with other types with different precisions.
d633afa
to
bc54a76
Compare
I believe that this is now, finally, ready to be merged. |
…ion_names Refactor names of BigFloat precision functions
Yep 👍 thanks for bearing with a few more rounds than usual. |
Thanks to all for the comments and help. |
This reduces the number of exported names from
Base
by 3 and makes them more flexible to be used with other types with different precisions.Fixes #13225.
Changes:
get_bigfloat_precision()
->precision(BigFloat)
set_bigfloat_precision(prec)
->setprecision(BigFloat, prec)
andsetprecision(prec)
with_bigfloat_precision(f, prec)
->setprecision(f, BigFloat, prec)
andsetprecision(f, prec)
The idea of reusing
setprecision
instead ofwith_bigfloat_precision
is due to @simonbyrneAlso, for consistency,
with_rounding(f, T, rounding_mode)
->setrounding(f, T, rounding_mode)
set_rounding(T, rounding_mode)
->setrounding(T, rounding_mode)
get_rounding(T)
->rounding(T)