Closed postmath closed 1 year ago
Maybe we should use MAG_BITS
instead of prec
for this, since the second half uses MAG_BITS
anyway.
Yes, that would be useful to have. I think there are a few places in the library where this ought to replace arb_abs
, too.
On it. Would you like to suggest a better name than arb_abs_slow
, or shall I use that?
Maybe arb_nonnegative_abs
to match arb_nonnegative_part
?
The prec
argument looks redundant.
Okay, I'll use that. Yes, I only used prec
before I realized the
precision would be dropped to MAG_BITS
anyway.
Erik
On Tue, Nov 8, 2022, 17:23 Fredrik Johansson @.***> wrote:
Maybe arb_nonnegative_abs to match arb_nonnegative_part?
The prec argument looks redundant.
— Reply to this email directly, view it on GitHub https://github.com/fredrik-johansson/arb/issues/441#issuecomment-1307912104, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDYH3X2O3STRAVV2NVXHPDWHLHE3ANCNFSM6AAAAAAR2XDEZA . You are receiving this because you authored the thread.Message ID: @.***>
Thinking about the name a bit more, arb_abs_nonnegative
feels more natural to me than arb_nonnegative_abs
. I'll go ahead with what you suggested originally, but let me know if you're okay with that name and I'll modify it.
The documentation for
arb_abs
states that "[n]o attempt is made to improve the interval represented by x if it contains zero". That is of course the right design for the "default" implementation of the abs function. But would it make sense to have an alternative that does do this? Something like this:If you like this idea, I'll write it up a bit more nicely, test & document it, and create a pull request. Otherwise we'll implement it in our wrapper library.