1 Wed May 19 12:14:19 1993 Torbjorn Granlund (tege@nada.kth.se)
3 * Many files: Call alloca(0) before function return.
5 * Makefile (IMPL_SRCS): Add alloca.c.
6 (IMPL_OBJS): Add alloca.o.
8 Fri May 14 00:52:01 1993 Torbjorn Granlund (tege@nada.kth.se)
10 * mpz_iset_str.c: Fix header comment.
12 * gmp.h: Don't test just FILE, tests some variants of _STDIO_H for
13 machines were FILE is a typedef.
15 Tue May 11 21:20:07 1993 Torbjorn Granlund (tege@nada.kth.se)
17 * Makefile (realclean): Make it just be like clean.
18 (In particular, don't delete Makefile...)
20 Thu May 6 14:31:02 1993 Torbjorn Granlund (tege@nada.kth.se)
22 * mpn_mul.c (vsize < KARATSUBA_THRESHOLD): Eliminate unused
25 * longlong.h (#if mc88110): Use local union to avoid explicit mov
27 * longlong.h (All union defs): Prepend __ before tags to avoid
28 conflicts. Cleanup union definitions to look the same.
30 * mpz_inp_str.c: Pass BASE to char_ok_for_base.
32 Wed May 5 01:25:23 1993 Torbjorn Granlund (tege@nada.kth.se)
34 * tests/tst-convert.c: Try base == 0.
36 * mpz_inp_str.c: Fix typo in assignment.
38 * longlong.h: Adjust UMUL_TIME and UDIV_TIME for several archs.
39 (#if hppa): Remove udiv_qrnnd.
40 (#if vax): Define sdiv_qrnnd. Use "g" constraint for umul_ppmm's
43 Tue May 4 17:11:55 1993 Torbjorn Granlund (tege@du.nada.kth.se)
45 * longlong.h (#if ns32000): Fix typo, udiv_qrnnd was div_qrnnd.
47 Mon May 3 00:20:52 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
49 * Makefile: Add rule for mp_bases.o.
51 * _mpz_set_str.c: Make inp_digit an mp_limb. Remove casts of
52 inp_digit to unsigned.
54 * mpn_dm_1.c: Use BITS_PER_MP_LIMB instead of 32.
55 * mpn_mod_1.c: Likewise.
56 * mpn_dm_1.c (udiv_qrnnd_preinv): Delete testing of overflow that
57 Peter Montgomery proved can't happen.
59 * tests/*.c: Include gmp-impl.h to make `inline' and `const' be
62 * Makefile: Update automatically generated dependencies.
64 * mpz_pow_ui: Don't include mp.h.
65 Use MP_INT instead of MINT even for rpow.
67 Sun May 2 16:35:53 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
69 * tests/tst-convert.c, tests/tst-dm_ui.c, tests/tst-mdm.c,
70 tests/tst-mdm_ui.c: New files.
71 * tests/tst-dm.c: New name for tests/tst-divmod.c.
72 * tests/*.c: Include urandom.h. Use urandom(), never random().
73 Restructure test code to be more consistent, define and use
74 dump_abort(), only dump input operands, generate negative operands
75 when allowed by the tested function, etc.
76 * tests/urandom.h: New file.
77 * tests/Makefile: Add new tests. Update dependencies.
79 (tests) Don't print "The tests passed" since we don't correctly
82 * mpz_fac_ui: Fix some comments.
84 * mpz_random.c, mpz_random2.c: Declare random();
85 Define random to call mrand48 for __alpha__.
87 * All files: Use #ifdef instead if #if for testing __STDC__.
89 * longlong.h (#if sparc_v8): Define UMUL_TIME and UDIV_TIME.
91 * mpz_inp_str.c: If BASE is 0, try to determine the base from the
92 leading characters. Restructure code.
94 * mpz_pprime_p.c: Include gmp-impl.h.
96 Fri Apr 30 09:35:03 1993 Torbjorn Granlund (tege@du.nada.kth.se)
98 * tests/Makefile: Set CC and OPT as in main Makefile.
101 * gmp.h: Remove declaration of mpz_not.
103 Thu Apr 29 19:51:34 1993 Torbjorn Granlund (tege@du.nada.kth.se)
105 * mpq_cmp.c: Fix header comment.
108 * mpz_inp_str.c: Get condition for char_ok_for_base right.
110 Tue Apr 27 12:30:48 1993 Torbjorn Granlund (tege@du.nada.kth.se)
112 * Makefile (check): Pass OPT to recursive make.
113 * tests/Makefile (OPT): Set to default value.
114 (CFLAGS): Don't include -g.
115 (tst-mul): Pass $(CFLAGS) to $(CC).
116 (tst-divmod): Likewise.
118 (tst-sqrtrem): Likewise.
120 * mpz_gcd.c: Fix typo in comments.
122 * mpz_sqrtrem.c: Really divide by zero for negative operands.
124 * mpz_mul_ui.c: Fix header comment.
126 * mpz_get_si.c: Fix type typo in cast.
128 Sun Apr 25 18:40:26 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
130 * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
131 * bsd/xtom.c: Likewise.
133 * cre-conv-tab.c: #include gmp.h and gmp-impl.h to get bit size
134 right for longlong.h.
135 * Makefile: Add new deps for `cre-conv-tab'.
137 * Makefile, tests/Makefile: Don't define or use srcdir.
139 * longlong.h (#if alpha): Define umul_ppmm.
140 Define UMUL_TIME and UDIV_TIME.
141 (#if i960): Define umul_ppmm and __umulsidi3.
142 (#if hppa): Define count_leading_zeros.
143 (#if IBMR2): Remove umul_ppmm. Define smul_ppmm.
144 (#if 68020): Define smul_ppmm.
145 (#if mc88110): Define umul_ppmm and udiv_qrnnd.
146 (#if ns32000): Define umul_ppmm.
147 (#if pyr): Rewrite umul_ppmm.
149 * mpz_powm: `carry_digit' => `carry_limb'.
150 * sdiv.c: Clearify comment.
152 Sat Apr 24 16:23:33 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
154 * tests: Update header comments. Make default sizes 8, use SIZE
155 symbol to allow user override. Increase default repetitions.
157 * longlong.h (__udiv_qrnnd_c): Define this always.
158 Make all variables `unsigned long int'.
159 (__LLDEBUG__): Remove this conditional.
161 * gmp-impl.h: #define ABS.
162 * (Many files): Use ABS instead of abs.
164 * _mpz_get_str, mpn_sqrt, mpz_clrbit, mpz_get_si, mpz_mod_2exp,
165 mpz_pow_ui, mpz_random2: Cast 1 to mp_limb before shifting.
167 * gmp.h: mpn_add returns mp_limb.
169 * mpz_perfsqr: Use #if, not plain if for exclusion of code for
172 Tue Apr 20 13:13:58 1993 Torbjorn Granlund (tege@du.nada.kth.se)
174 * mpn_sqrt: Handle overflow for intermediate quotients by rounding
177 * mpz_random2: Back to random(); rand() is so bad we get into cycles.
179 * mpz_perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
181 * mpz_inp_str.c (char_ok_for_base): New function.
182 (mpz_inp_str): Use it.
184 * gmp.h: Add `const' to decl of mpz_probab_pripe_p.
186 * _mpz_set_str.c (char_type): Remove final `,'.
187 (ascii_to_num): Likewise.
189 Sun Mar 28 21:54:06 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
191 * mpz_inp_raw: Allocate x_index, not xsize limbs.
193 Mon Mar 15 11:44:06 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
195 * mpz_pprime_p.c: Declare param `const'.
196 * gmp.h: Add declarations for mpz_com.
198 Thu Feb 18 14:10:34 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
200 * mpq_add, mpq_sub: Call mpz_clear for t.
202 Fri Feb 12 20:27:34 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
204 * mpz_inp_str: Recog minus sign as first character.
206 Wed Feb 3 01:36:02 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
208 * mpz_random.c (urandom): New conditionally defined local function.
209 Use it instead of random().
210 * mpz_random2: Use rand() instead of random() here, since we don't
211 care how many bits we get.
213 * mpz_iset: Handle 0 size.
215 Tue Feb 2 13:03:33 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
217 * _mpz_get_str: Adjust for negative msize when returning str.
219 * mpz_mod_ui: Initialize dividend_size before it's used.
221 Mon Jan 4 09:11:15 1993 Torbjorn Granlund (tege@sics.se)
223 * itom: Declare param explicitly 'signed'.
226 * mpq_cmp: Remove unused variable tmp_size.
227 * mpz_powm_ui: Fix typo in esize==0 if stmt.
228 * mpz_powm: Likewise.
230 Sun Nov 29 01:16:11 1992 Torbjorn Granlund (tege@sics.se)
232 * mpn_dm_1.c (mpn_divmod_1): Handle
233 divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
236 Sat Nov 28 17:19:40 1992 Torbjorn Granlund (tege@sics.se)
238 * mpz_div: Remove free_me and free_me_size and their usage.
240 Wed Oct 28 17:40:04 1992 Torbjorn Granlund (tege@jupiter.sics.se)
242 * longlong.h (__hppa umul_ppmm): Fix typos.
243 (__hppa sub_ddmmss): Swap input arguments.
245 * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
248 Sun Oct 25 20:30:06 1992 Torbjorn Granlund (tege@jupiter.sics.se)
250 * mpz_pprime_p.c (mpz_probab_prime_p): Handle numbers <= 3
251 specifically (used to consider all negative numbers prime).
253 * mpz_powm_ui: `carry_digit' => `carry_limb'.
255 * sdiv: Handle zero dividend specifically. Replace most code in
256 this function with a call to mpn_divmod_1.
258 * mpn_add: Return type is mp_limb.
260 * _mpz_get_str: Assign and use MSIZE smarter, to avoid using
262 * _mpz_get_str: Allocate extra STR space if (MSIZE < 0) for minus
264 * _mpz_get_str: Move string backwards smarter, avoid copying when
267 * gmp.h (mpn_lshift, mpn_rshift, mpn_rshiftci): Remove `long' from
269 * Makefile.in (MP_OBJS) : Include mpz_sizeinb.o.
271 Fri Sep 11 22:15:55 1992 Torbjorn Granlund (tege@tarrega.sics.se)
273 * mpq_clear: Don't free the MP_RAT!
275 * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
277 Thu Sep 3 01:47:07 1992 Torbjorn Granlund (tege@jupiter.sics.se)
279 * mpn_mul: Rewrite code jumping between `carry case' and `noncarry
280 case' to avoid jumping. Special case for V_LIMB being 0 ot 1.
281 * All files: Remove leading _ from mpn function names.
283 Wed Sep 2 22:21:16 1992 Torbjorn Granlund (tege@jupiter.sics.se)
285 Fix from Jan-Hein Buhrman:
286 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
288 * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
291 Sun Aug 30 18:37:15 1992 Torbjorn Granlund (tege@jupiter.sics.se)
293 * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
294 * _mpz_get_str: Don't remove leading zeros. Abort if there are some.
296 Tue Feb 18 14:38:39 1992 Torbjorn Granlund (tege@zevs.sics.se)
298 longlong.h (hppa umul_ppmm): Add missing semicolon. Declare type
301 Fri Feb 14 21:33:21 1992 Torbjorn Granlund (tege@zevs.sics.se)
303 * longlong.h: Make default count_leading_zeros work for machines >
304 32 bits. Prepend `__' before local variables to avoid conflicts
305 with users' variables.
307 Thu Feb 6 15:10:42 1992 Torbjorn Granlund (tege@zevs.sics.se)
309 * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
310 pre-inverting divisor.
312 Sun Feb 2 11:10:25 1992 Torbjorn Granlund (tege@sics.se)
314 * longlong.h: Make __LLDEBUG__ work differently.
315 (_IBMR2): Reinsert old code.
317 Sat Feb 1 16:43:00 1992 Torbjorn Granlund (tege@sics.se)
319 * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
320 using floating point operations. Don't define
321 UDIV_NEEDS_NORMALIZATION any longer.
323 Fri Jan 31 15:09:13 1992 Torbjorn Granlund (tege@sics.se)
325 * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
326 * longlong.h (#ifdef __hppa): Define umul_ppmm.
328 Wed Jan 29 16:41:36 1992 Torbjorn Granlund (tege@sics.se)
330 * mpn_cmp: Only one length parameter, assume operand lengths are
331 the same. Don't require normalization.
332 * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
333 new mpn_cmp definition.
335 Tue Jan 28 11:18:55 1992 Torbjorn Granlund (tege@sics.se)
337 * _mpz_get_str: Fix typo in comment.
339 Mon Jan 27 09:44:16 1992 Torbjorn Granlund (tege@sics.se)
341 * Makefile.in: Add new files.
343 * mpn_dm_1.c: New file with function _mpn_divmod_1.
344 * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
345 * mpz_div_ui: Likewise.
347 * mpn_mod_1.c: New file with function _mpn_mod_1.
348 * mpz_mod_ui: Use _mpn_mod_1.
350 Thu Jan 23 18:54:09 1992 Torbjorn Granlund (tege@sics.se)
352 Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
353 * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
354 Handle dividend == 0.
356 Wed Jan 22 12:02:26 1992 Torbjorn Granlund (tege@sics.se)
358 * mpz_pprime_p.c: Use "" for #include.
360 Sun Jan 19 13:36:55 1992 Torbjorn Granlund (tege@sics.se)
362 * mpn_rshiftci.c (header): Correct comment.
364 Wed Jan 15 18:56:04 1992 Torbjorn Granlund (tege@sics.se)
366 * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
367 to make space for ignored quotient at the end. (The quotient might
368 always be an extra limb.)
370 Tue Jan 14 21:28:48 1992 Torbjorn Granlund (tege@sics.se)
372 * mpz_powm_ui: Fix comment.
373 * mpz_powm: Likewise.
375 Mon Jan 13 18:16:25 1992 Torbjorn Granlund (tege@sics.se)
377 * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
379 Sun Jan 12 13:54:28 1992 Torbjorn Granlund (tege@sics.se)
381 Fixes from Kazumaro Aoki:
382 * mpz_out_raw: Take abs of size to handle negative values.
383 * mpz_inp_raw: Reallocate before reading ptr from X.
384 * mpz_inp_raw: Store, don't read, size to x->size.
386 Tue Jan 7 17:50:25 1992 Torbjorn Granlund (tege@sics.se)
388 * gmp.h, mp.h: Remove parameter names from prototypes.
390 Sun Dec 15 00:09:36 1991 Torbjorn Granlund (tege@sics.se)
392 * tests/Makefile.in: Prepend "./" to file names when executing
395 * Makefile.in: Fix many problems.
397 Sat Dec 14 01:00:02 1991 Torbjorn Granlund (tege@sics.se)
399 * mpn_sqrt.c: New file with _mpn_sqrt.
400 * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
401 * msqrt.c: Delete. Create from mpz_sqrtrem.c in Makefile.in.
402 * mpz_do_sqrt.c: Delete.
403 * Makefile.in: Update to reflect these changes.
405 * Makefile.in, configure, configure.subr: New files
406 (from bothner@cygnus.com).
407 * dist-Makefile: Delete.
409 * mpz_fac_ui: Fix comment.
411 * mpz_random2: Rewrite to make it possible for the most significant
414 * mpz_pprime_p.c (mpz_probab_prime_p): Remove \t\n.
416 Fri Dec 13 23:10:02 1991 Torbjorn Granlund (tege@sics.se)
418 * mpz_do_sqrt: Simplify special case for U == 0.
419 * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
420 Rename _mpz_impl_sqrt to _mpz_do_sqrt.
422 Fri Dec 13 12:52:28 1991 Torbjorn Granlund (tege@sics.se)
424 * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
426 Thu Dec 12 22:17:29 1991 Torbjorn Granlund (tege@sics.se)
428 * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
429 variables to mp_size.
431 Wed Dec 11 22:00:34 1991 Torbjorn Granlund (tege@sics.se)
433 * mpn_rshift.c: Fix header comments.
435 Mon Dec 9 17:46:10 1991 Torbjorn Granlund (tege@sics.se)
439 * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
441 * dist-Makefile: Add missing dependency for cre-mparam.
443 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
444 mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
446 * dist-Makefile (clean): clean in tests subdir too.
447 * tests/Makefile: Define default values for ROOT and SUB.
449 * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
452 Mon Nov 11 00:06:05 1991 Torbjorn Granlund (tege@sics.se)
454 * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
456 Sat Nov 9 23:47:38 1991 Torbjorn Granlund (tege@sics.se)
460 * dist-Makefile, Makefile, tests/Makefile: Merge tests into
463 Fri Nov 8 22:57:19 1991 Torbjorn Granlund (tege@sics.se)
465 * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
467 Thu Nov 7 22:06:46 1991 Torbjorn Granlund (tege@sics.se)
469 * longlong.h: Cosmetic changes to keep it identical to gcc2 version
471 * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
474 Mon Nov 4 00:36:46 1991 Torbjorn Granlund (tege@sics.se)
476 * mpn_mul: Fix indentation.
478 * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
480 * mpz_do_sqrt: Handle overflow in conversion from double returned
483 * gmp.h: Add missing function definitions.
485 Sun Nov 3 18:25:25 1991 Torbjorn Granlund (tege@sics.se)
487 * mpz_pow_ui: Change type of `i' to int.
489 * ChangeLog: Add change log entry.
490 * ChangeLog: Add change log entry.
491 * ChangeLog: Add change log entry.
492 * ChangeLog: Add change log entry.
493 * ChangeLog: Add change log entry.
494 * ChangeLog: Add change log entry.
495 * ChangeLog: Add change log entry.
496 * ChangeLog: Add change log entry.
499 * mpz_pow_ui.c: Fix typo in comment.
501 * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
502 * mpz_powm_ui.c: Add code for rpow.
503 * rpow.c: Delete this file. The rpow function is now implemented
506 * mpz_fac_ui.c: New file.
507 * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
509 Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
510 * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
511 the first argument not smaller than the second.
513 Tue Oct 29 13:56:55 1991 Torbjorn Granlund (tege@sics.se)
515 * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
518 Mon Oct 28 00:35:29 1991 Torbjorn Granlund (tege@sics.se)
520 * mpz_random2: Handle size == 0.
522 * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
523 chars_per_bit_exactly, and change its definition.
524 * cre-conv-tab.c (main): Output field according to its new
526 * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
527 Use chars_per_bit_exactly.
529 * mpz_random2: Change the loop termination condition in order to
530 get a large most significant limb with higher probability.
532 * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
533 * mpz_get_si.c: New file.
534 * dist-Makefile: Add mpz_random2 and mpz_get_si.
536 * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
537 power of 2, giving exact result.
539 * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
540 * mpn_mul: New macro KARATSUBA_THRESHOLD.
541 * mpn_mul (karatsuba's algorithm): Don't write intermediate results
542 to prodp, use temporary pp instead. (Intermediate results can be
543 larger than the final result, possibly writing into hyperspace.)
544 * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
546 * mpn_mul: Fix typo, cy instead of xcy. Unify carry handling code.
548 Sun Oct 27 19:57:32 1991 Torbjorn Granlund (tege@sics.se)
550 * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
551 when usize > 1.5 vsize.
553 * mpn_mul: Break between classical and Karatsuba's algorithm at
554 KARATSUBA_THRESHOLD, if defined. Default to 8.
556 * mpn_div: Kludge to fix stray memory read.
558 Sat Oct 26 20:06:14 1991 Torbjorn Granlund (tege@sics.se)
560 * mpz_gcdext: Handle a = b = 0. Remove memory leakage by calling
561 mpz_clear for all temporary variables.
563 * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
564 function's argument constraints. Compute wsize correctly.
566 * mpz_gcd: Fix typo in comment.
568 * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
569 abort if allocation fails, don't just exit.
571 Fri Oct 25 22:17:20 1991 Torbjorn Granlund (tege@sics.se)
573 * mpz_random2.c: New file.
575 Thu Oct 17 18:06:42 1991 Torbjorn Granlund (tege@sics.se)
577 Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
578 * mpq_cmp: Take sign into account, don't just compare the
580 * mpq_cmp: Call _mpn_mul in the right way, with the first argument
581 not smaller than the second.
583 Wed Oct 16 19:27:32 1991 Torbjorn Granlund (tege@sics.se)
585 * mpz_random: Ensure the result is normalized.
587 Tue Oct 15 14:55:13 1991 Torbjorn Granlund (tege@sics.se)
589 * mpz_clrbit: Support non-ANSI compilers.
591 Wed Oct 9 18:03:28 1991 Torbjorn Granlund (tege@sics.se)
593 * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
595 Tue Oct 8 17:42:59 1991 Torbjorn Granlund (tege@sics.se)
597 * mpz_mdm_ui: Add comments.
599 * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
600 * mpz_init_ui: Change spacing and header comment.
602 Thu Oct 3 18:36:13 1991 Torbjorn Granlund (tege@sics.se)
604 * dist-Makefile: Prepend `./' before some filenames.
606 Sun Sep 29 14:02:11 1991 Torbjorn Granlund (tege@sics.se)
608 Released 1.1 (public).
610 * mpz_com: New name of mpz_not.
611 * dist-Makefile: Change mpz_not to mpz_com.
613 Tue Sep 24 12:44:11 1991 Torbjorn Granlund (tege@sics.se)
615 * longlong.h: Fix header comment.
617 Mon Sep 9 15:16:24 1991 Torbjorn Granlund (tege@sics.se)
621 * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
624 * longlong.h (m68000 umul_ppmm): Clobber one register less by
625 slightly rearranging the code.
627 Sun Sep 1 18:53:25 1991 Torbjorn Granlund (tege@sics.se)
629 * dist-Makefile (stamp-stddefh): Fix typo.
631 Sat Aug 31 20:41:31 1991 Torbjorn Granlund (tege@sics.se)
635 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
636 mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
637 * gmp.h, gmp.texi: Define the new functions.
639 Fri Aug 30 08:32:56 1991 Torbjorn Granlund (tege@sics.se)
641 * mpz_gcdext: Compute t argument from the other quantities at the
642 end, of the function, not in the loop. New feature: Allow t to be
645 * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
646 include "mp.h". Use type name `MP_INT' always.
648 * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
650 Wed Aug 28 00:45:11 1991 Torbjorn Granlund (tege@sics.se)
652 * dist-Makefile (documentation): Go via tmp.texi to avoid the
653 creation of gmp.dvi if any errors occur. Make tex read input
656 Fri Aug 23 15:58:52 1991 Torbjorn Granlund (tege@sics.se)
658 * longlong.h (68020, i386): Don't define machine-dependent
659 __umulsidi3 (so the default definition is used).
660 * longlong.h (all machines): Cast all operands, sources and
661 destinations, to `unsigned long int'.
662 * longlong.h: Add gmicro support.
664 Thu Aug 22 00:28:29 1991 Torbjorn Granlund (tege@sics.se)
666 * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
667 * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
668 * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
669 * _mpz_get_str.c: Add code to do division by big_base using only
670 umul_qrnnd, if that is faster. Use UMUL_TIME and UDIV_TIME to
671 decide which variant to use.
673 Wed Aug 21 15:45:23 1991 Torbjorn Granlund (tege@sics.se)
675 * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
676 nops. (Saves two insn.)
678 * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
679 branch, and to permit input/output register overlap.
681 * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
682 * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
683 asm statements (gives better code if either the upper or lower
684 part of the product is unused.
686 Tue Aug 20 17:57:59 1991 Torbjorn Granlund (tege@sics.se)
688 * _mpz_get_str.c (outside of functions): Remove
689 num_to_ascii_lower_case and num_to_ascii_upper_case. Use string
690 constants in the function instead.
692 Mon Aug 19 00:37:42 1991 Torbjorn Granlund (tege@sics.se)
694 * cre-conv-tab.c (main): Output table in hex. Output 4 fields, not
695 3, for components 0 and 1.
697 * gmp.h: Add declaration of mpq_neg.
701 * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
702 comparing to enum literals SPC and EOF. This makes the code work
703 for compilers where `char' is unsigned. (Bug found by Brian
708 * mpz_mod_ui: Remove references to quot. Remove quot_ptr, quot_size
709 declarations and assignment code.
711 Sun Aug 18 14:44:26 1991 Torbjorn Granlund (tege@sics.se)
713 * mpz_mod_ui: Handle dividend < 0.
717 * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
718 general structure, variable names, etc.
720 * sdiv: Un-normalize the remainder in n1 before it is negated.
722 * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
725 * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
726 the quotient size if the dividend size is incremented. (Bug found
729 * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
730 (Bug found by Brian Beuning.)
732 * mpz_mod_ui: Replace "digit" by "limb".
734 * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
735 for non-32-bit machines (PP is hardwired for such machines).
736 * mpz_perfsqr.c (outside of functions): Define PP value with an L.
738 * mpn_mul.c (_mpn_mul): Add verification code that is activated if
739 DEBUG is defined. Replace "digit" by "limb".
740 * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
742 * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
743 and v0_size, and according to the result, swap arguments in
744 recursive call. (Don't violate mpn_mul's own argument
747 Fri Aug 16 13:47:12 1991 Torbjorn Granlund (tege@sics.se)
751 * longlong.h (IBMR2): Add udiv_qrnnd.
753 * mpz_perfsqr: Remove unused variables.
755 * mpz_and (case for different signs): Initialize loop variable i!
757 * dist-Makefile: Update automatically generated dependencies.
758 * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
759 etc to dependency file lists.
761 * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
763 * longlong.h: Add `int' after `unsigned' and `long' everywhere.
765 Wed Aug 14 18:06:48 1991 Torbjorn Granlund (tege@sics.se)
767 * longlong.h: Add ARM, i860 support.
769 * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
771 Tue Aug 13 21:57:43 1991 Torbjorn Granlund (tege@sics.se)
773 * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
774 mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
775 * gmp-impl.h: Put it here, and make it `const'.
776 * cre-conv-tab.c (main): Make struct __mp_bases `const'.
778 Mon Aug 12 17:11:46 1991 Torbjorn Granlund (tege@sics.se)
780 * cre-conv-tab.c (main): Use %lu in printf for long ints.
782 * dist-Makefile: Fix cre-* dependencies.
784 * cre-conv-tab.c (main): Output field big_base_inverted.
786 * gmp-impl.h (struct bases): New field big_base_inverted.
787 * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
788 to float (in order to keep the structure smaller).
790 * mp.h, gmp.h: Change names of macros for avoiding multiple
793 Fri Aug 9 18:01:36 1991 Torbjorn Granlund (tege@sics.se)
795 * _mpz_get_str: Only shift limb array if normalization_steps != 0
798 * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
799 * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
800 and m1 (overlap between output and input operands did not work).
801 * longlong.h: Add VAX, ROMP and HP-PA support.
802 * longlong.h: Sort the machine dependent code in alphabetical order
804 * longlong.h: Hack comments.
806 Thu Aug 8 14:13:36 1991 Torbjorn Granlund (tege@sics.se)
810 * longlong.h: Define BITS_PER_LONG to 32 if it's not already
812 * Define __BITS4 to BITS_PER_LONG / 4.
813 * Don't assume 32 bit word size in "count_leading_zeros" C macro.
814 Use __BITS4 and BITS_PER_LONG instead.
816 * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
818 * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
819 even for plain mc68000.
821 * mpq_div: Flip the sign of the numerator *and* denominator of the
822 result if the intermediate denominator is negative.
824 * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
826 * mpz_and.c: Compute the result size more conservatively.
827 * mpz_ior.c: Likewise.
829 * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
831 * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
834 * dist-Makefile: Create mult.c from mpz_mul.c.
835 * mult.c: Delete this file.
837 * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
838 not done properly if the input string had many leading zeros).
840 Sun Aug 4 16:54:14 1991 Torbjorn Granlund (tege@sics.se)
842 * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
843 work with VPATH and GNU MP.
845 * mpz_gcd: Don't call mpz_set; inline its functionality.
847 * mpq_mul, mpq_div: Fix several serious typos.
849 * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
852 * mpq_neg.c: New file.
854 * dist-Makefile: Remove obsolete dependencies.
858 Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
859 * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
861 * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
863 Sat Aug 3 23:45:28 1991 Torbjorn Granlund (tege@sics.se)
865 * longlong.h: Clean up comments.
866 * longlong.h: #undef internal macros.
868 Fri Aug 2 18:29:11 1991 Torbjorn Granlund (tege@sics.se)
870 * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
871 * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
873 * mpz_dmincl.c: Normalize the remainder before shifting it back.
875 * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
877 * mpn_div.c: Fix comment.
879 * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
880 type, in order to work for both GNU and Berkeley functions.
882 * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
883 madd.c from mpz_add.c, msub.c from mpz_sub.c.
885 * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
886 * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
887 Berkeley function name variants.
888 * dist-Makefile: Add created files to "clean" target.
890 Tue Jul 16 15:19:46 1991 Torbjorn Granlund (tege@sics.se)
892 * mpq_get_den: No need for absolute value of the size, the
893 denominator is always positive.
895 * mpz_get_ui: If the operand is zero, return zero. Don't read the
898 * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
899 is the size of the remainder.
901 Mon Jul 15 11:08:05 1991 Torbjorn Granlund (tege@sics.se)
903 * Several files: Remove unused variables and functions.
905 * gmp-impl.h: Declare _mpz_impl_sqrt.
907 * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
908 UDIV_NEEDS_NORMALIZATION. (Fix from Brian Beuning.)
910 * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
912 * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
913 * mpz_ior: Add missing else statement in OP1 | -OP2 case.
914 * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
915 * mpz_ior: Duplicate _mpz_realloc code.
917 * mpz_and: Add missing else statement in -OP1 & -OP2 case.
918 * mpz_and: Rewrite OP1 & -OP2 case.
919 * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
921 * mpz_gcdext: Loop in d1.size (not b->size). (Fix from Brian
924 * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call. (Fix from
927 Fri Jul 12 17:10:33 1991 Torbjorn Granlund (tege@sics.se)
929 * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
930 mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
933 * mpz_dmincl.c: Remove second re-allocation of rem->d. It
936 * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
937 some unixes' test doesn't have the -r option).
939 * *.*: Cast allocated pointers to the appropriate type (makes old C
942 * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
943 after conversion to double. (Kludge for broken C compilers.)
945 * dist-Makefile (stamp-stddefh): New target. Test if "stddef.h"
946 exists in the system and creates a minimal one if it does not
948 * cre-stddefh.c: New file.
949 * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
950 * dist-Makefile (clean): Add some more.
951 * gmp.h, mp.h: Unconditionally include "stddef.h".
953 Thu Jul 11 10:08:21 1991 Torbjorn Granlund (tege@sics.se)
955 * min: Do ungetc of last read character.
956 * min.c: include stdio.h.
958 * dist-Makefile: Go via tmp- files for cre* redirection.
959 * dist-Makefile: Add tmp* to "clean" target.
961 * dist-Makefile: Use LOCAL_CC for cre*, to simplyfy cross
964 * gmp.h, mp.h: Don't define NULL here.
965 * gmp-impl.h: Define it here.
967 Wed Jul 10 14:13:33 1991 Torbjorn Granlund (tege@sics.se)
969 * mpz_mod_2exp: Don't copy too much, overwriting most significant
972 * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
973 reallocating res, if op[12]_ptr got their value from alloca.
975 * mpz_and, mpz_ior: Clear up comments.
977 * cre-mparam.c: Output parameters for `short int' and `int'.
979 * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
981 Tue Jul 9 18:40:30 1991 Torbjorn Granlund (tege@sics.se)
983 * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
984 (Fix for Sun lossage.)
986 * gmp.h: Add declaration of mpq_clear.
988 * dist-Makefile: Chack if "ranlib" exists, before using it.
989 * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
990 * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
992 Fri Jul 5 19:08:09 1991 Torbjorn Granlund (tege@sics.se)
994 * move: Remove incorrect comment.
996 * mpz_free, mpq_free: Rename to *_clear.
997 * dist-Makefile: Likewise.
998 * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
1000 * mpz_dmincl.c: Don't call "move", inline its functionality.
1002 Thu Jul 4 00:06:39 1991 Torbjorn Granlund (tege@sics.se)
1004 * Makefile: Include dist-Makefile. Fix dist target to include
1005 dist-Makefile (with the name "Makefile" in the archive).
1007 * dist-Makefile: New file made from Makefile. Add new mpz_...
1010 * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
1011 functionality. Avoids code duplication.
1012 * pow.c, mpz_powm.c: Include mpz_powincl.c
1014 * mpz_dmincl.c: New file containing general division code. Avoids
1016 * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
1019 * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
1020 Instead, write the overlapping memory copying inline.
1022 * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
1024 * longlong.h: Don't use #elif.
1025 * mpz_do_sqrt.c: Likewise.
1027 * longlong.h: Use __asm__ instead of asm.
1028 * longlong.h (sparc udiv_qrnnd): Make it to one string over several
1031 * longlong.h: Preend __ll_ to B, highpart, and lowpart.
1033 * longlong.h: Move array t in count_leading_zeros to the new file
1034 mp_clz_tab.c. Rename the array __clz_tab.
1035 * All files: #ifdef for traditional C compatibillity.
1037 Wed Jul 3 11:42:14 1991 Torbjorn Granlund (tege@sics.se)
1039 * mpz_and: Initialize res_ptr always (used to be initialized only
1042 * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
1043 `unsigned int', and cast the multiplications. This way
1044 compilers more easily can choose cheaper multiplication
1047 * mpz_mod_2exp: Handle input argument < modulo argument.
1048 * mpz_many: Make sure mp_size is the type for sizes, not int.
1050 * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
1051 mpq_div: Change mpz_init* interface. Structure pointer as first
1052 arg to initialization function, no longer *return* struct.
1054 Sun Jun 30 19:21:44 1991 Torbjorn Granlund (tege@sics.se)
1056 * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
1057 character file name length limit.
1059 * Most files: Rename MINT to MP_INT. Rename MRAT to MP_RAT.
1060 * mpz_sizeinb.c: New file with function mpz_sizeinbase.
1061 * mp_bases.c: New file, with array __mp_bases.
1062 * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
1064 * mout, mpz_out_str: Use array __mp_bases instead of function
1066 * mpz_get_cvtlen.c: Remove.
1069 Sat Jun 29 21:57:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
1071 * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
1072 * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
1073 * longlong.h (__sparc__): Don't call .umul; expand asm instead.
1074 Don't define __umulsidi3 (i.e. use default definition).
1076 Mon Jun 24 17:37:23 1991 Torbjorn Granlund (tege@amon.sics.se)
1078 * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
1081 Sat Jun 22 13:54:01 1991 Torbjorn Granlund (tege@zevs.sics.se)
1083 * mpz_gcdext.c: New file.
1085 * mpn_mul: Handle carry and unexpected operand sizes in last
1086 additions/subtractions. (Bug trigged when v1_size == 1.)
1088 * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
1089 * mpq_*: Call mpz_init*.
1091 * mpz_pow_ui, rpow: Use _mpn_mul instead of mult. Restructure.
1093 Wed May 29 20:32:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
1095 * mpz_get_cvtlen: multiply by size.
1097 Sun May 26 15:01:15 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
1101 Fixes from Doug Lea (dl@g.oswego.edu):
1102 * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE). Adjust PROD_SIZE
1104 * mpz_div: Prepend _ to mpz_realloc.
1105 * mpz_set_xs, mpz_set_ds: Fix typos in function name.
1107 Sat May 25 22:51:16 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
1109 * mpz_divmod_ui: New function.
1111 * sdiv: Make the sign of the remainder correct.
1113 Thu May 23 15:28:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
1115 * Alpha-release 0.94.
1117 * mpz_mul_ui: Include longlong.h.
1119 * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
1122 * mpz_impl_sqrt: Don't call "move", inline its functionality.
1124 * mdiv: Use MPN_COPY instead of memcpy.
1125 * rpow, mpz_mul, mpz_mod_2exp: Likewise.
1126 * pow.c: Likewise, and fix bug in the size arg.
1128 * xtom: Don't use mpz_alloc, inline needed code instead. Call
1129 _mpz_set_str instead of mpz_set_str.
1131 * Makefile: Make two libraries, libmp.a and libgmp.a.
1133 Thu May 22 20:25:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
1135 * Add manual to distribution.
1136 * Fold in many missing routines descibed in the manual.
1139 Wed May 22 13:48:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
1141 * mpz_set_str: Make it handle 0x prefix OK.
1143 Sat May 18 18:31:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
1145 * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
1147 * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
1150 Thu May 16 20:43:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
1152 * memory.c: Make the default allocations functions global.
1153 * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
1154 default memory function.
1156 Wed May 8 20:02:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
1158 * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
1159 even if no normalization is needed.
1160 * mpz_div: Rework reallocation scheme, to avoid excess copying.
1162 * mpz_sub_ui.c, mpz_add_ui.c: New files.
1164 * mpz_cmp.c, mpz_cmp_ui.c: New files.
1166 * mpz_mul_2exp: Handle zero input MINT correctly.
1168 * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
1170 * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
1172 Tue May 7 15:44:58 1991 Torbjorn Granlund (tege@zevs.sics.se)
1174 * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
1175 * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
1176 * gcd, mpz_gcd: Likewise.
1178 * gcd, mpz_gcd: Handle common 2 factors correctly.
1180 Mon May 6 20:22:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
1182 * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
1184 * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
1186 Sun May 5 15:16:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
1188 * mpz_div: Remove test for QUOT == 0.
1190 Sun Apr 28 20:21:04 1991 Torbjorn Granlund (tege@zevs.sics.se)
1192 * pow: Don't make MOD normalization in place, as it's a bad idea to
1193 write on an input parameter.
1194 * pow: Reduce BASE if it's > MOD.
1195 * pow, mult, mpz_mul: Simplify realloc code.
1197 Sat Apr 27 21:03:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
1199 * Install multplication using Karatsuba's algorithm as default.
1201 Fri Apr 26 01:03:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
1203 * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
1205 * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
1207 * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
1209 * mlshift.c, mrshift.c: Remove.
1211 Wed Apr 24 21:39:22 1991 Torbjorn Granlund (tege@zevs.sics.se)
1213 * mpn_mul: Check only for m2_size == 0 in function header.
1215 Mon Apr 22 01:31:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
1217 * karatsuba.c: New file for Karatsuba's multplication algorithm.
1219 * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
1221 * mpn_cmp: Fix header comment.
1223 Sun Apr 21 00:10:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
1225 * pow: Switch off initial base reduction.
1227 Sat Apr 20 22:06:05 1991 Torbjorn Granlund (tege@echnaton.sics.se)
1229 * mpz_get_str: Don't generate initial zeros for initial word.
1230 Used to write outside of allocated storage.
1232 Mon Apr 15 15:48:08 1991 Torbjorn Granlund (tege@zevs.sics.se)
1234 * _mpz_realloc: Make it accept size in number of mp_digits.
1235 * Most functions: Use new _mpz_realloc definition.
1237 * mpz_set_str: Remove calls _mp_free_func.
1239 * Most functions: Rename mpn_* to _mpn_*. Rename mpz_realloc to
1241 * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
1242 * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
1243 * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
1245 Sat Apr 6 14:05:16 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
1247 * mpn_mul: Multiply by the first digit in M2 in a special
1248 loop instead of zeroing the product area.
1250 * mpz_abs.c: New file.
1252 * sdiv: Implement as mpz_div_si for speed.
1254 * mpn_add: Make it work for second source operand == 0.
1256 * msub: Negate the correct operand, i.e. V before swapping, not
1257 the smaller of U and V!
1258 * madd, msub: Update abs_* when swapping operands, and not after
1261 Fri Apr 5 00:19:36 1991 Torbjorn Granlund (tege@black.nada.kth.se)
1263 * mpn_sub: Make it work for subtrahend == 0.
1265 * madd, msub: Rewrite to minimize mpn_cmp calls. Ensure
1266 mpn_cmp is called with positive sizes (used to be called
1267 incorrectly with negative sizes sometimes).
1269 * msqrt: Make it divide by zero if fed with a negative number.
1270 * Remove if statement at end of precision calculation that was
1273 * itom, mp.h: The argument is of type short, not int.
1275 * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
1277 * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
1279 * Add COPYING to distribution.
1281 * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
1283 Fri Mar 15 00:26:29 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
1285 * Add Copyleft headers to all files.
1287 * mpn_mul.c, mpn_div.c: Add header comments.
1288 * mult.c, mdiv.c: Update header comments.
1290 * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
1291 mpq_free.c: New files for rational arithmetics.
1293 * mpn_lshift.c: Avoid writing the most significant word if it is 0.
1295 * mdiv.c: Call mpn_lshift for the normalization.
1296 * mdiv.c: Remove #ifdefs.
1298 * Makefile: Add ChangeLog to DISTFILES.
1300 * mpn_div.c: Make the add_back code work (by removing abort()).
1301 * mpn_div.c: Make it return if the quotient is size as compared
1302 with the difference NSIZE - DSIZE. If the stored quotient is
1303 larger than that, return 1, otherwise 0.
1304 * gmp.h: Fix mpn_div declaration.
1305 * mdiv.c: Adopt call to mpn_div.
1306 * mpz_div.c: New file (developed from mdiv.c).
1308 * README: Update routine names.
1310 Thu Mar 14 18:45:28 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
1312 * mpq_mul.c: New file for rational multplication.
1314 * gmp.h: Add definitions for rational arithmetics.
1316 * mpn_div: Kludge the case where the high numerator digit > the
1317 high denominator digit. (This code is going to be optimized later.)
1319 * New files: gmp.h for GNU specific functions, gmp-common.h for
1320 definitions common for mp.h and gmp.h.
1322 * Ensure mp.h just defines what BSD mp.h defines.
1324 * pow.c: Fix typo for bp allocation.
1326 * Rename natural number functions to mpn_*, integer functions to
1329 Tue Mar 5 18:47:04 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
1331 * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
1332 "n0 >= r" to "n0 > r".
1334 * msqrt: Tune the increasing precision scheme, to do fewer steps.
1336 Tue Mar 3 18:50:10 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
1338 * msqrt: Use the low level routines. Use low precision in the
1339 beginning, and increase the precision as the result converges.
1340 (This optimization gave a 6-fold speedup.)
1346 version-control: never