Closed hannorein closed 3 years ago
ARF_RND_DOWN
is slightly faster than the other rounding modes in terms of low-level operations. I have considered changing the ARB_RND
to ARF_RND_NEAR
since it buys a little bit of accuracy, but it would need testing and profiling.
There is no real reason for not having another function like arb_set_round
but which takes a rounding mode as input; it has just not been implemented. arb_set_round
does not take a rounding parameter because it is used all over the place to change the precision of balls, and specifying the rounding mode would add clutter.
Thanks for the quick reply! That makes perfect sense.
Maybe adding a short note in the documentation would help others (see pull request)
First of all thank you for developing this library. It's fantastic.
I have a (probably naive) question about the rounding mode of
arb_set_round()
. I can see that it is set toARB_RND
which is set toARF_RND_DOWN
.What is the reason for it rounding down by default? Wouldn't it make sense to have the function take an additional argument the same way the
arf_set_round()
function does? For my application, I need to round to the nearest number. Right now I'm just calling the underlyingarf_set_round()
myself. But I wonder if I'm missing something since there is apparently no built-in function to round anarbt_t
to anarb_t
with a specific rounding mode.