Lines Matching defs:Bigint
46 * of return type *Bigint all return NULL to indicate a malloc failure.
297 /* struct Bigint is used to represent arbitrary-precision integers. These
300 Bigint then x->wds >= 1, and either x->wds == 1 or x[wds-1] is nonzero.
302 The Bigint fields are as follows:
307 - k indicates which pool this Bigint was allocated from
315 - x contains the vector of words (digits) for this Bigint, from least
320 Bigint {
321 struct Bigint *next;
326 typedef struct Bigint Bigint;
349 static Bigint *freelist[Kmax+1];
351 /* Allocate space for a Bigint with up to 1<<k digits */
353 static Bigint *
357 Bigint *rv;
364 len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
367 rv = (Bigint*)pmem_next;
371 rv = (Bigint*)MALLOC(len*sizeof(double));
382 /* Free a Bigint allocated with Balloc */
385 Bfree(Bigint *v)
404 /* Allocate space for a Bigint with up to 1<<k digits */
406 static Bigint *
410 Bigint *rv;
414 len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
417 rv = (Bigint*)MALLOC(len*sizeof(double));
427 /* Free a Bigint allocated with Balloc */
430 Bfree(Bigint *v)
442 /* Multiply a Bigint b by m and add a. Either modifies b in place and returns
446 static Bigint *
447 multadd(Bigint *b, int m, int a) /* multiply by m and add a */
457 Bigint *b1;
495 decimal separator at position nd0, which is ignored) to a Bigint. This
500 static Bigint *
503 Bigint *b;
610 /* convert a small nonnegative integer to a Bigint */
612 static Bigint *
615 Bigint *b;
625 /* multiply two Bigints. Returns a new Bigint, or NULL on failure. Ignores
628 static Bigint *
629 mult(Bigint *a, Bigint *b)
631 Bigint *c;
729 static Bigint *p5s;
731 /* multiply the Bigint b by 5**k. Returns a pointer to the result, or NULL on
733 Bigint b will have been Bfree'd. Ignores the sign of b. */
735 static Bigint *
736 pow5mult(Bigint *b, int k)
738 Bigint *b1, *p5, *p51;
791 static Bigint *
792 pow5mult(Bigint *b, int k)
794 Bigint *b1, *p5, *p51;
838 /* shift a Bigint b left by k bits. Return a pointer to the shifted result,
842 static Bigint *
843 lshift(Bigint *b, int k)
846 Bigint *b1;
890 cmp(Bigint *a, Bigint *b)
918 /* Take the difference of Bigints a and b, returning a new Bigint. Returns
922 static Bigint *
923 diff(Bigint *a, Bigint *b)
925 Bigint *c;
1014 /* Convert a Bigint to a double plus an exponent */
1017 b2d(Bigint *a, int *e)
1051 /* Convert a scaled double to a Bigint plus an exponent. Similar to d2b,
1057 Returns a Bigint b and an integer e such that
1072 static Bigint *
1075 Bigint *b;
1121 /* Convert a double to a Bigint plus an exponent. Return NULL on failure.
1123 Given a finite nonzero double d, return an odd Bigint b and exponent *e
1130 static Bigint *
1133 Bigint *b;
1179 ratio(Bigint *a, Bigint *b)
1220 dshift(Bigint *b, int p2)
1228 /* special case of Bigint division. The quotient is always in the range 0 <=
1233 quorem(Bigint *b, Bigint *S)
1399 Bigint *b, *d;
1517 Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
2267 sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (unsigned)i;
2301 Bigint *b = (Bigint *)((int *)s - 1);
2388 Bigint *b, *b1, *delta, *mlo, *mhi, *S;