Newer
Older
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
not done properly if the input string had many leading zeros).
Sun Aug 4 16:54:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
* dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
work with VPATH and GNU MP.
* mpz_gcd: Don't call mpz_set; inline its functionality.
* mpq_mul, mpq_div: Fix several serious typos.
* mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
zero.
* mpq_neg.c: New file.
* dist-Makefile: Remove obsolete dependencies.
* mpz_sub: Fix typo.
Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
* mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
is just 1.
* mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
Sat Aug 3 23:45:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
* longlong.h: Clean up comments.
* longlong.h: #undef internal macros.
Fri Aug 2 18:29:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
* mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
* mpz_dmincl.c: Normalize the remainder before shifting it back.
* mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
* mpn_div.c: Fix comment.
* mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
type, in order to work for both GNU and Berkeley functions.
* dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
madd.c from mpz_add.c, msub.c from mpz_sub.c.
respectively.
* pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
* mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
Berkeley function name variants.
* dist-Makefile: Add created files to "clean" target.
Tue Jul 16 15:19:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpq_get_den: No need for absolute value of the size, the
denominator is always positive.
* mpz_get_ui: If the operand is zero, return zero. Don't read the
limb array!
* mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
is the size of the remainder.
Mon Jul 15 11:08:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Several files: Remove unused variables and functions.
* gmp-impl.h: Declare _mpz_impl_sqrt.
* mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
UDIV_NEEDS_NORMALIZATION. (Fix from Brian Beuning.)
* mpz_dm_ui.c, sdiv: Replace *digit with *limb.
* mpz_ior: Add missing else statement in -OP1 | -OP2 case.
* mpz_ior: Add missing else statement in OP1 | -OP2 case.
* mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
* mpz_ior: Duplicate _mpz_realloc code.
* mpz_and: Add missing else statement in -OP1 & -OP2 case.
* mpz_and: Rewrite OP1 & -OP2 case.
* mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
* mpz_gcdext: Loop in d1.size (not b->size). (Fix from Brian
Beuning.)
* mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call. (Fix from
Brian Beuning.)
Fri Jul 12 17:10:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
New files.
* mpz_dmincl.c: Remove second re-allocation of rem->d. It
was never executed.
* dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
some unixes' test doesn't have the -r option).
* *.*: Cast allocated pointers to the appropriate type (makes old C
compilers happier).
* cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
after conversion to double. (Kludge for broken C compilers.)
* dist-Makefile (stamp-stddefh): New target. Test if "stddef.h"
exists in the system and creates a minimal one if it does not
exist.
* cre-stddefh.c: New file.
* dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
* dist-Makefile (clean): Add some more.
* gmp.h, mp.h: Unconditionally include "stddef.h".
Thu Jul 11 10:08:21 1991 Torbjorn Granlund (tege@zevs.sics.se)
* min: Do ungetc of last read character.
* min.c: include stdio.h.
* dist-Makefile: Go via tmp- files for cre* redirection.
* dist-Makefile: Add tmp* to "clean" target.
* dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
compilation.
* gmp.h, mp.h: Don't define NULL here.
* gmp-impl.h: Define it here.
Wed Jul 10 14:13:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_mod_2exp: Don't copy too much, overwriting most significant
limb.
* mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
reallocating res, if op[12]_ptr got their value from alloca.
* mpz_and, mpz_ior: Clear up comments.
* cre-mparam.c: Output parameters for `short int' and `int'.
* mpz_and, mpz_ior: Negate negative op[12]_size in several places.
Tue Jul 9 18:40:30 1991 Torbjorn Granlund (tege@zevs.sics.se)
* gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
(Fix for Sun lossage.)
* gmp.h: Add declaration of mpq_clear.
* dist-Makefile: Check if "ranlib" exists, before using it.
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
* dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
* mpz_powm: Fix typo, "pow" instead of "mpz_powm".
Fri Jul 5 19:08:09 1991 Torbjorn Granlund (tege@zevs.sics.se)
* move: Remove incorrect comment.
* mpz_free, mpq_free: Rename to *_clear.
* dist-Makefile: Likewise.
* mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
* mpz_dmincl.c: Don't call "move", inline its functionality.
Thu Jul 4 00:06:39 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Makefile: Include dist-Makefile. Fix dist target to include
dist-Makefile (with the name "Makefile" in the archive).
* dist-Makefile: New file made from Makefile. Add new mpz_...
functions.
* mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
functionality. Avoids code duplication.
* pow.c, mpz_powm.c: Include mpz_powincl.c
* mpz_dmincl.c: New file containing general division code. Avoids
code duplication.
* mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
mpz_dmincl.c.
* _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
Instead, write the overlapping memory copying inline.
* mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
* longlong.h: Don't use #elif.
* mpz_do_sqrt.c: Likewise.
* longlong.h: Use __asm__ instead of asm.
* longlong.h (sparc udiv_qrnnd): Make it to one string over several
lines.
* longlong.h: Preend __ll_ to B, highpart, and lowpart.
* longlong.h: Move array t in count_leading_zeros to the new file
mp_clz_tab.c. Rename the array __clz_tab.
* All files: #ifdef for traditional C compatibility.
Wed Jul 3 11:42:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_and: Initialize res_ptr always (used to be initialized only
when reallocating).
* longlong.h (umul_ppmm [C variant]): Make __ul...__vh
`unsigned int', and cast the multiplications. This way
compilers more easily can choose cheaper multiplication
instructions.
* mpz_mod_2exp: Handle input argument < modulo argument.
* mpz_many: Make sure mp_size is the type for sizes, not int.
* mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
mpq_div: Change mpz_init* interface. Structure pointer as first
arg to initialization function, no longer *return* struct.
Sun Jun 30 19:21:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
character file name length limit.
* Most files: Rename MINT to MP_INT. Rename MRAT to MP_RAT.
* mpz_sizeinb.c: New file with function mpz_sizeinbase.
* mp_bases.c: New file, with array __mp_bases.
* _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
__mp_bases instead.
* mout, mpz_out_str: Use array __mp_bases instead of function
_mpz_get_cvtlen.
* mpz_get_cvtlen.c: Remove.
* Makefile: Update.
Sat Jun 29 21:57:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
* longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
* longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
* longlong.h (__sparc__): Don't call .umul; expand asm instead.
Don't define __umulsidi3 (i.e. use default definition).
Mon Jun 24 17:37:23 1991 Torbjorn Granlund (tege@amon.sics.se)
* _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
Swap 't' and 's'.
Sat Jun 22 13:54:01 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_gcdext.c: New file.
* mpn_mul: Handle carry and unexpected operand sizes in last
additions/subtractions. (Bug trigged when v1_size == 1.)
* mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
* mpq_*: Call mpz_init*.
* mpz_pow_ui, rpow: Use _mpn_mul instead of mult. Restructure.
Wed May 29 20:32:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_get_cvtlen: multiply by size.
Sun May 26 15:01:15 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
Alpha-release 0.95.
Fixes from Doug Lea (dl@g.oswego.edu):
* mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE). Adjust PROD_SIZE
correctly.
* mpz_div: Prepend _ to mpz_realloc.
* mpz_set_xs, mpz_set_ds: Fix typos in function name.
Sat May 25 22:51:16 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
* mpz_divmod_ui: New function.
* sdiv: Make the sign of the remainder correct.
Thu May 23 15:28:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Alpha-release 0.94.
* mpz_mul_ui: Include longlong.h.
* mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
of msqrt.
* mpz_impl_sqrt: Don't call "move", inline its functionality.
* mdiv: Use MPN_COPY instead of memcpy.
* rpow, mpz_mul, mpz_mod_2exp: Likewise.
* pow.c: Likewise, and fix bug in the size arg.
* xtom: Don't use mpz_alloc, inline needed code instead. Call
_mpz_set_str instead of mpz_set_str.
* Makefile: Make two libraries, libmp.a and libgmp.a.
Thu May 22 20:25:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Add manual to distribution.
* Fold in many missing routines described in the manual.
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
* Update Makefile.
Wed May 22 13:48:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_set_str: Make it handle 0x prefix OK.
Sat May 18 18:31:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
* memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
arguments.
* mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
* min: Likewise.
Thu May 16 20:43:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
* memory.c: Make the default allocations functions global.
* mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
default memory function.
Wed May 8 20:02:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
even if no normalization is needed.
* mpz_div: Rework reallocation scheme, to avoid excess copying.
* mpz_sub_ui.c, mpz_add_ui.c: New files.
* mpz_cmp.c, mpz_cmp_ui.c: New files.
* mpz_mul_2exp: Handle zero input MINT correctly.
* mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
* mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
Tue May 7 15:44:58 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
* mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
* gcd, mpz_gcd: Likewise.
* gcd, mpz_gcd: Handle common 2 factors correctly.
Mon May 6 20:22:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
* gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
* gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
Sun May 5 15:16:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpz_div: Remove test for QUOT == 0.
Sun Apr 28 20:21:04 1991 Torbjorn Granlund (tege@zevs.sics.se)
* pow: Don't make MOD normalization in place, as it's a bad idea to
write on an input parameter.
* pow: Reduce BASE if it's > MOD.
* pow, mult, mpz_mul: Simplify realloc code.
Sat Apr 27 21:03:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
* Install multiplication using Karatsuba's algorithm as default.
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
Fri Apr 26 01:03:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
* msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
* mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
left, respectively.
* gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
* mlshift.c, mrshift.c: Remove.
Wed Apr 24 21:39:22 1991 Torbjorn Granlund (tege@zevs.sics.se)
* mpn_mul: Check only for m2_size == 0 in function header.
Mon Apr 22 01:31:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
* karatsuba.c: New file for Karatsuba's multiplication algorithm.
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
* mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
* mpn_cmp: Fix header comment.
Sun Apr 21 00:10:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
* pow: Switch off initial base reduction.
Sat Apr 20 22:06:05 1991 Torbjorn Granlund (tege@echnaton.sics.se)
* mpz_get_str: Don't generate initial zeros for initial word.
Used to write outside of allocated storage.
Mon Apr 15 15:48:08 1991 Torbjorn Granlund (tege@zevs.sics.se)
* _mpz_realloc: Make it accept size in number of mp_digits.
* Most functions: Use new _mpz_realloc definition.
* mpz_set_str: Remove calls _mp_free_func.
* Most functions: Rename mpn_* to _mpn_*. Rename mpz_realloc to
_mpz_realloc.
* mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
* mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
* msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
Sat Apr 6 14:05:16 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
* mpn_mul: Multiply by the first digit in M2 in a special
loop instead of zeroing the product area.
* mpz_abs.c: New file.
* sdiv: Implement as mpz_div_si for speed.
* mpn_add: Make it work for second source operand == 0.
* msub: Negate the correct operand, i.e. V before swapping, not
the smaller of U and V!
* madd, msub: Update abs_* when swapping operands, and not after
(optimization).
Fri Apr 5 00:19:36 1991 Torbjorn Granlund (tege@black.nada.kth.se)
* mpn_sub: Make it work for subtrahend == 0.
* madd, msub: Rewrite to minimize mpn_cmp calls. Ensure
mpn_cmp is called with positive sizes (used to be called
incorrectly with negative sizes sometimes).
* msqrt: Make it divide by zero if fed with a negative number.
* Remove if statement at end of precision calculation that was
never true.
* itom, mp.h: The argument is of type short, not int.
* mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
* mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
* Add COPYING to distribution.
* mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
Fri Mar 15 00:26:29 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
* Add Copyleft headers to all files.
* mpn_mul.c, mpn_div.c: Add header comments.
* mult.c, mdiv.c: Update header comments.
* mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
mpq_free.c: New files for rational arithmetics.
* mpn_lshift.c: Avoid writing the most significant word if it is 0.
* mdiv.c: Call mpn_lshift for the normalization.
* mdiv.c: Remove #ifdefs.
* Makefile: Add ChangeLog to DISTFILES.
* mpn_div.c: Make the add_back code work (by removing abort()).
* mpn_div.c: Make it return if the quotient is size as compared
with the difference NSIZE - DSIZE. If the stored quotient is
larger than that, return 1, otherwise 0.
* gmp.h: Fix mpn_div declaration.
* mdiv.c: Adopt call to mpn_div.
* mpz_div.c: New file (developed from mdiv.c).
* README: Update routine names.
Thu Mar 14 18:45:28 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
* mpq_mul.c: New file for rational multiplication.
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
* gmp.h: Add definitions for rational arithmetics.
* mpn_div: Kludge the case where the high numerator digit > the
high denominator digit. (This code is going to be optimized later.)
* New files: gmp.h for GNU specific functions, gmp-common.h for
definitions common for mp.h and gmp.h.
* Ensure mp.h just defines what BSD mp.h defines.
* pow.c: Fix typo for bp allocation.
* Rename natural number functions to mpn_*, integer functions to
mpz_*.
Tue Mar 5 18:47:04 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
* mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
"n0 >= r" to "n0 > r".
* msqrt: Tune the increasing precision scheme, to do fewer steps.
Tue Mar 3 18:50:10 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
* msqrt: Use the low level routines. Use low precision in the
beginning, and increase the precision as the result converges.
(This optimization gave a 6-fold speedup.)