diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-25 10:57:16 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-25 10:57:16 +0000 |
commit | b68f58c2b0296e05803f657eccf7f75b54da2f08 (patch) | |
tree | 253574825351c49cd8d119351a391e05b3f24bcd | |
parent | 8dd0bbfd0dc2fee95d214c962d013d97de22d084 (diff) | |
download | mpfr-b68f58c2b0296e05803f657eccf7f75b54da2f08.tar.gz |
Simplify the code.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2811 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | add.c | 1 | ||||
-rw-r--r-- | add1sp.c | 4 | ||||
-rw-r--r-- | sgn.c | 12 | ||||
-rw-r--r-- | sub1sp.c | 3 |
4 files changed, 6 insertions, 14 deletions
@@ -20,7 +20,6 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include "mpfr-impl.h" int @@ -22,7 +22,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> - #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" @@ -172,8 +171,7 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) { /* dm = 0 and m > 0: Just copy */ MPFR_ASSERTD(m!=0); - /* Must use INCR since src & dest may overlap and dest <= src */ - MPN_COPY_INCR(cp, MPFR_MANT(c)+m, n-m); + MPN_COPY(cp, MPFR_MANT(c)+m, n-m); MPN_ZERO(cp+n-m, m); } else if (MPFR_LIKELY(m == 0)) @@ -26,12 +26,8 @@ int mpfr_sgn (mpfr_srcptr a) { if (MPFR_UNLIKELY( MPFR_IS_SINGULAR(a) )) - { - /* Only infinite is signed */ - if (MPFR_IS_INF(a)) - return MPFR_INT_SIGN(a); - else - return 0; - } - return MPFR_INT_SIGN(a); + /* Only infinite is signed */ + return MPFR_IS_INF (a) ? MPFR_INT_SIGN (a) : 0; + else + return MPFR_INT_SIGN (a); } @@ -460,8 +460,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) { /* dm = 0 and m > 0: Just copy */ MPFR_ASSERTD(m!=0); - /* Must use INCR since src & dest may overlap and dest <= src */ - MPN_COPY_INCR(cp, MPFR_MANT(c)+m, n-m); + MPN_COPY(cp, MPFR_MANT(c)+m, n-m); MPN_ZERO(cp+n-m, m); } else if (MPFR_LIKELY(m == 0)) |