-
Notifications
You must be signed in to change notification settings - Fork 6
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
AbstractFloat interface functions #101
Comments
exp1m is the first thing i came into. Maybe you could look at how ArbNumerics made it ? |
@lrnv locally you can define it as for Base.eps(x::Arblib.ArbOrRef) = Arb(Arblib.set_ulp!(Mag(), Arblib.midref(x), prec=precision(x))) (it is necessary to pass precision explicitly here as function Base.eps(x::Arblib.ArbOrRef)
res = Arb(prec = precision(x))
Arblib.set_ulp!(Arblib.radref(res), Arblib.midref(x), prec=precision(x))
return res
end the first one results in julia> eps(rand(Arb))
[1.7272337110188889250772703725600799142232000728872562770047406940337183606325e-77 +/- 1.46e-154] the second with
or we could marry both function Base.eps(x::Arblib.ArbOrRef)
res = Arb(prec = precision(x))
Arblib.set_ulp!(Arblib.radref(res), Arblib.midref(x), prec=precision(x))
Arblib.midref(res)[] = Arblib.radref(res)
Arblib.zero!(Arblib.radref(res))
return res
end Hmm... interesting:
@Joel-Dahne could you please explain why this printing of |
Many good ideas here! I'll have to get back when I have more time. But I can at least comment about the printing. Yes, it's related to the guaranteed digits and comes from the fact that we determine the number of digits to print based on the precision (using
It seems like choosing a default printing is a non-trivial task to do... We should probably experiment a bit with it and see what we like in the end. At the very least we should mention something about it in the documentation. |
to make Arbs slightly easier to use in generic numerical code
that includes low level functions such as:
eps
exponent
and high level that could be composed of
Arblib
functionsexpm1
(needs to be added toArblib.jl/src/arithmetic.jl
Line 56 in bc9dc58
seefixed by add expm1 #102)...
The text was updated successfully, but these errors were encountered: