diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-10-30 14:50:52 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-10-30 14:50:52 +0000 |
commit | fe05de2a9a80b73b90382529767b68780c3bcf09 (patch) | |
tree | 0b5b7a395a5cdb7e131442fb4c49fed6ed95b006 /cos.c | |
parent | e0b73cd20c1a05dc1018d3b9963d4446ae8e5a95 (diff) | |
download | mpfr-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |