summaryrefslogtreecommitdiff
path: root/cbrt.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2004-01-14 17:18:34 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2004-01-14 17:18:34 +0000
commitf9106da753829c3adca5c0cf8c38c4608cc34218 (patch)
tree2cbb6e0fc012305dc760d50ec8cb93f5b8e746ce /cbrt.c
parent0a40b14f2ae6f51268df552f999845f23de4a321 (diff)
downloadmpfr-f9106da753829c3adca5c0cf8c38c4608cc34218.tar.gz
Changed some error messages into assertions.
Removed some useless #include's. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2622 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'cbrt.c')
-rw-r--r--cbrt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/cbrt.c b/cbrt.c
index eae5d71dd..bd7d15177 100644
--- a/cbrt.c
+++ b/cbrt.c
@@ -1,6 +1,6 @@
/* mpfr_cbrt -- cube root function.
-Copyright 2002, 2003 Free Software Foundation.
+Copyright 2002, 2003, 2004 Free Software Foundation.
Contributed by the Spaces project, INRIA Lorraine.
This file is part of the MPFR Library.
@@ -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 <stdio.h>
#include <stdlib.h>
#include "gmp.h"
#include "gmp-impl.h"
@@ -46,7 +45,7 @@ MA 02111-1307, USA. */
*/
int
-mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
+mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
{
mpz_t m;
@@ -78,7 +77,7 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
else
MPFR_ASSERTN(0);
}
- /* Useless due to mpz_init
+ /* Useless due to mpz_init
MPFR_CLEAR_FLAGS(y);*/
mpz_init (m);
@@ -95,7 +94,7 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
n = MPFR_PREC(y);
if (rnd_mode == GMP_RNDN)
n ++;
-
+
/* we want 3*n-2 <= size_m + 3*sh + r <= 3*n
i.e. 3*sh + size_m + r <= 3*n */
sh = (3 * n - size_m - r) / 3;