summaryrefslogtreecommitdiff
path: root/dim.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-12 11:06:02 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-12 11:06:02 +0000
commitde270d93ff8bda096cf06fb8cee328ef221a5da8 (patch)
treefbab636f164aa6780ac6b1ea787ee578d8c70e74 /dim.c
parent42b84d65710af7fb156a581dd9715332a10e6765 (diff)
downloadmpfr-de270d93ff8bda096cf06fb8cee328ef221a5da8.tar.gz
new test file for mpfr_dim
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2679 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'dim.c')
-rw-r--r--dim.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dim.c b/dim.c
index 90c637aab..02dfc6a50 100644
--- a/dim.c
+++ b/dim.c
@@ -1,4 +1,4 @@
-/* mpfr_dim -- dim of x, y
+/* mpfr_dim -- positive difference
Copyright 2001, 2002, 2004 Free Software Foundation.
@@ -21,11 +21,11 @@ MA 02111-1307, USA. */
#include "mpfr-impl.h"
- /* The computation of z=dim(x,y)
+/* dim (x,y) is defined as:
x-y if x > y
+0 if x <= y
- */
+*/
int
mpfr_dim (mpfr_ptr z, mpfr_srcptr x ,mpfr_srcptr y , mp_rnd_t rnd_mode)
@@ -39,8 +39,8 @@ mpfr_dim (mpfr_ptr z, mpfr_srcptr x ,mpfr_srcptr y , mp_rnd_t rnd_mode)
}
}
- if (mpfr_cmp(x,y) > 0)
- return mpfr_sub(z, x, y, rnd_mode);
+ if (mpfr_cmp (x,y) > 0)
+ return mpfr_sub (z, x, y, rnd_mode);
else
{
MPFR_SET_ZERO(z);