add arb_get_mid_arb / arb_get_rad_arb

This commit is contained in:
Fredrik Johansson 2015-09-24 00:03:26 +02:00
parent f529b48fc5
commit 5b5a0c094d
2 changed files with 22 additions and 0 deletions

14
arb.h
View file

@ -382,6 +382,20 @@ arb_get_mag(mag_t z, const arb_t x)
mag_clear(t);
}
ARB_INLINE void
arb_get_mid_arb(arb_t z, const arb_t x)
{
arf_set(arb_midref(z), arb_midref(x));
mag_zero(arb_radref(z));
}
ARB_INLINE void
arb_get_rad_arb(arb_t z, const arb_t x)
{
arf_set_mag(arb_midref(z), arb_radref(x));
mag_zero(arb_radref(z));
}
ARB_INLINE void
arb_get_abs_ubound_arf(arf_t u, const arb_t x, long prec)
{

View file

@ -283,6 +283,14 @@ Random number generation
Radius and interval operations
-------------------------------------------------------------------------------
.. function:: void arb_get_mid_arb(arb_t m, const arb_t x)
Sets *m* to the midpoint of *x*.
.. function:: void arb_get_rad_arb(arb_t r, const arb_t x)
Sets *m* to the radius of *x*.
.. function:: void arb_add_error_arf(arb_t x, const arf_t err)
.. function:: void arb_add_error_mag(arb_t x, const mag_t err)