summaryrefslogtreecommitdiff
path: root/cos.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-10-30 14:50:52 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-10-30 14:50:52 +0000
commitfe05de2a9a80b73b90382529767b68780c3bcf09 (patch)
tree0b5b7a395a5cdb7e131442fb4c49fed6ed95b006 /cos.c
parente0b73cd20c1a05dc1018d3b9963d4446ae8e5a95 (diff)
downloadmpfr-fe05de2a9a80b73b90382529767b68780c3bcf09.tar.gz
Fixed padding-bit test.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3911 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'cos.c')
-rw-r--r--cos.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cos.c b/cos.c
index 0b704c86d..c35399f4e 100644
--- a/cos.c
+++ b/cos.c
@@ -41,12 +41,13 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r)
/* compute minimal i such that i*(i+1) does not fit in an unsigned long,
assuming that there are no padding bits. */
maxi = 1UL << (CHAR_BIT * sizeof(unsigned long) / 2);
- if (maxi * (maxi-1) == 0) /* test checked at compile time */
+ if (maxi * (maxi / 2) == 0) /* test checked at compile time */
{
/* can occur only when there are padding bits. */
+ /* maxi * (maxi-1) is representable iff maxi * (maxi / 2) != 0 */
do
maxi /= 2;
- while (maxi * (maxi-1) == 0);
+ while (maxi * (maxi / 2) == 0);
}
mpz_init (x);