From a8ad82f43cb499dbb16722a074d5337db887a194 Mon Sep 17 00:00:00 2001 From: Alexander Kobel Date: Thu, 23 Jul 2015 12:20:42 +0200 Subject: [PATCH] change argument order for arb_abs and arb_neg; correct documentation of arb_abs --- arb.h | 5 ++--- arb/abs.c | 7 +++---- arb/neg.c | 7 +++---- doc/source/arb.rst | 3 +-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/arb.h b/arb.h index 0b644870..ced4c9b5 100644 --- a/arb.h +++ b/arb.h @@ -190,11 +190,11 @@ void arb_set_round(arb_t z, const arb_t x, long prec); void arb_trim(arb_t y, const arb_t x); -void arb_neg(arb_t x, const arb_t y); +void arb_neg(arb_t y, const arb_t x); void arb_neg_round(arb_t x, const arb_t y, long prec); -void arb_abs(arb_t x, const arb_t y); +void arb_abs(arb_t y, const arb_t x); void _arb_digits_round_inplace(char * s, mp_bitcnt_t * shift, fmpz_t error, long n, arf_rnd_t rnd); @@ -1070,4 +1070,3 @@ void arb_atan_arf_bb(arb_t z, const arf_t x, long prec); #endif #endif - diff --git a/arb/abs.c b/arb/abs.c index 6501eee5..8e6b1b5c 100644 --- a/arb/abs.c +++ b/arb/abs.c @@ -26,9 +26,8 @@ #include "arb.h" void -arb_abs(arb_t x, const arb_t y) +arb_abs(arb_t y, const arb_t x) { - arf_abs(arb_midref(x), arb_midref(y)); - mag_set(arb_radref(x), arb_radref(y)); + arf_abs(arb_midref(y), arb_midref(x)); + mag_set(arb_radref(y), arb_radref(x)); } - diff --git a/arb/neg.c b/arb/neg.c index 3fb65277..c8a09d46 100644 --- a/arb/neg.c +++ b/arb/neg.c @@ -26,9 +26,8 @@ #include "arb.h" void -arb_neg(arb_t x, const arb_t y) +arb_neg(arb_t y, const arb_t x) { - arf_neg(arb_midref(x), arb_midref(y)); - mag_set(arb_radref(x), arb_radref(y)); + arf_neg(arb_midref(y), arb_midref(x)); + mag_set(arb_radref(y), arb_radref(x)); } - diff --git a/doc/source/arb.rst b/doc/source/arb.rst index 21dca2b4..e8b28138 100644 --- a/doc/source/arb.rst +++ b/doc/source/arb.rst @@ -525,7 +525,7 @@ Arithmetic Sets *y* to the negation of *x*. -.. function:: void arb_abs(arb_t x, const arb_t y) +.. function:: void arb_abs(arb_t y, const arb_t x) Sets *y* to the absolute value of *x*. No attempt is made to improve the interval represented by *x* if it contains zero. @@ -1429,4 +1429,3 @@ Vector functions Calls :func:`arb_get_unique_fmpz` elementwise and returns nonzero if all entries can be rounded uniquely to integers. If any entry in *vec* cannot be rounded uniquely to an integer, returns zero. -