summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-25 10:57:16 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-25 10:57:16 +0000
commitb68f58c2b0296e05803f657eccf7f75b54da2f08 (patch)
tree253574825351c49cd8d119351a391e05b3f24bcd
parent8dd0bbfd0dc2fee95d214c962d013d97de22d084 (diff)
downloadmpfr-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.c1
-rw-r--r--add1sp.c4
-rw-r--r--sgn.c12
-rw-r--r--sub1sp.c3
4 files changed, 6 insertions, 14 deletions
diff --git a/add.c b/add.c
index d01150556..abb4a6646 100644
--- a/add.c
+++ b/add.c
@@ -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
diff --git a/add1sp.c b/add1sp.c
index 62e61040a..535b37ea3 100644
--- a/add1sp.c
+++ b/add1sp.c
@@ -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))
diff --git a/sgn.c b/sgn.c
index ad4028744..95eeeeac2 100644
--- a/sgn.c
+++ b/sgn.c
@@ -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);
}
diff --git a/sub1sp.c b/sub1sp.c
index e5387a8c2..595408461 100644
--- a/sub1sp.c
+++ b/sub1sp.c
@@ -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))