~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/mpn/generic/divrem_1.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* mpn_divrem_1 -- mpn by limb division.
2
2
 
3
 
Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free Software
 
3
Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002, 2003 Free Software
4
4
Foundation, Inc.
5
5
 
6
6
This file is part of the GNU MP Library.
17
17
 
18
18
You should have received a copy of the GNU Lesser General Public License
19
19
along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
20
 
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
 
MA 02111-1307, USA. */
 
20
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
21
MA 02110-1301, USA. */
22
22
 
23
23
#include "gmp.h"
24
24
#include "gmp-impl.h"
127
127
            }
128
128
          for (i = qxn - 1; i >= 0; i--)
129
129
            {
130
 
              udiv_qrnnd (*qp, r, r, 0, d);
 
130
              udiv_qrnnd (*qp, r, r, CNST_LIMB(0), d);
131
131
              r >>= GMP_NAIL_BITS;
132
132
              qp--;
133
133
            }
148
148
            }
149
149
          for (i = qxn - 1; i >= 0; i--)
150
150
            {
151
 
              udiv_qrnnd_preinv (*qp, r, r, 0, d, dinv);
 
151
              udiv_qrnnd_preinv (*qp, r, r, CNST_LIMB(0), d, dinv);
152
152
              r >>= GMP_NAIL_BITS;
153
153
              qp--;
154
154
            }
161
161
      int norm;
162
162
 
163
163
      /* Skip a division if high < divisor (high quotient 0).  Testing here
164
 
         before before normalizing will still skip as often as possible.  */
 
164
         before normalizing will still skip as often as possible.  */
165
165
      if (un != 0)
166
166
        {
167
167
          n1 = up[un - 1] << GMP_NAIL_BITS;
207
207
            }
208
208
          for (i = qxn - 1; i >= 0; i--)
209
209
            {
210
 
              udiv_qrnnd (*qp, r, r, 0, d);
 
210
              udiv_qrnnd (*qp, r, r, CNST_LIMB(0), d);
211
211
              r >>= GMP_NAIL_BITS;
212
212
              qp--;
213
213
            }
237
237
            }
238
238
          for (i = qxn - 1; i >= 0; i--)
239
239
            {
240
 
              udiv_qrnnd_preinv (*qp, r, r, 0, d, dinv);
 
240
              udiv_qrnnd_preinv (*qp, r, r, CNST_LIMB(0), d, dinv);
241
241
              r >>= GMP_NAIL_BITS;
242
242
              qp--;
243
243
            }