summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-07-10 01:32:58 +0200
committerKevin Ryde <user42@zip.com.au>2001-07-10 01:32:58 +0200
commitbfc1db42872f0afc735ca3f6c49fbc62b57abdd0 (patch)
treec994d9a7fe175f375b85349b888811d8a5606b84
parentaa5b9117519b6c4e8ca09cb44dfb664c504ac714 (diff)
downloadgmp-bfc1db42872f0afc735ca3f6c49fbc62b57abdd0.tar.gz
* mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
i386 gcc 2.95.x), remove a bogus comment about quotient.
-rw-r--r--mpz/tdiv_ui.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/mpz/tdiv_ui.c b/mpz/tdiv_ui.c
index 8e9929e4a..c08ed6707 100644
--- a/mpz/tdiv_ui.c
+++ b/mpz/tdiv_ui.c
@@ -1,5 +1,4 @@
-/* mpz_tdiv_ui(dividend, divisor_limb)
- -- Return DIVDEND mod DIVISOR_LIMB.
+/* mpz_tdiv_ui(dividend, divisor_limb) -- Return DIVDEND mod DIVISOR_LIMB.
Copyright 1991, 1993, 1994, 1996, 1997, 1998, 2001 Free Software Foundation,
Inc.
@@ -27,21 +26,9 @@ MA 02111-1307, USA. */
unsigned long int
mpz_tdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
{
- mp_size_t dividend_size;
- mp_size_t size;
- mp_limb_t remainder_limb;
-
if (divisor == 0)
DIVIDE_BY_ZERO;
- dividend_size = dividend->_mp_size;
- size = ABS (dividend_size);
-
- /* No need for temporary allocation and copying if QUOT == DIVIDEND as
- the divisor is just one limb, and thus no intermediate remainders
- need to be stored. */
-
- remainder_limb = mpn_mod_1 (dividend->_mp_d, size, (mp_limb_t) divisor);
-
- return remainder_limb;
+ return mpn_mod_1 (PTR(dividend), (mp_size_t) ABSIZ(dividend),
+ (mp_limb_t) divisor);
}