Lines Matching defs:Bigint

46  *     of return type *Bigint all return NULL to indicate a malloc failure.
303 /* struct Bigint is used to represent arbitrary-precision integers. These
306 Bigint then x->wds >= 1, and either x->wds == 1 or x[wds-1] is nonzero.
308 The Bigint fields are as follows:
313 - k indicates which pool this Bigint was allocated from
321 - x contains the vector of words (digits) for this Bigint, from least
326 Bigint {
327 struct Bigint *next;
332 typedef struct Bigint Bigint;
355 static Bigint *freelist[Kmax+1];
357 /* Allocate space for a Bigint with up to 1<<k digits */
359 static Bigint *
363 Bigint *rv;
370 len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
373 rv = (Bigint*)pmem_next;
377 rv = (Bigint*)MALLOC(len*sizeof(double));
388 /* Free a Bigint allocated with Balloc */
391 Bfree(Bigint *v)
410 /* Allocate space for a Bigint with up to 1<<k digits */
412 static Bigint *
416 Bigint *rv;
420 len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
423 rv = (Bigint*)MALLOC(len*sizeof(double));
433 /* Free a Bigint allocated with Balloc */
436 Bfree(Bigint *v)
448 /* Multiply a Bigint b by m and add a. Either modifies b in place and returns
452 static Bigint *
453 multadd(Bigint *b, int m, int a) /* multiply by m and add a */
458 Bigint *b1;
488 decimal separator at position nd0, which is ignored) to a Bigint. This
493 static Bigint *
496 Bigint *b;
603 /* convert a small nonnegative integer to a Bigint */
605 static Bigint *
608 Bigint *b;
618 /* multiply two Bigints. Returns a new Bigint, or NULL on failure. Ignores
621 static Bigint *
622 mult(Bigint *a, Bigint *b)
624 Bigint *c;
683 static Bigint *p5s;
685 /* multiply the Bigint b by 5**k. Returns a pointer to the result, or NULL on
687 Bigint b will have been Bfree'd. Ignores the sign of b. */
689 static Bigint *
690 pow5mult(Bigint *b, int k)
692 Bigint *b1, *p5, *p51;
745 static Bigint *
746 pow5mult(Bigint *b, int k)
748 Bigint *b1, *p5, *p51;
792 /* shift a Bigint b left by k bits. Return a pointer to the shifted result,
796 static Bigint *
797 lshift(Bigint *b, int k)
800 Bigint *b1;
844 cmp(Bigint *a, Bigint *b)
872 /* Take the difference of Bigints a and b, returning a new Bigint. Returns
876 static Bigint *
877 diff(Bigint *a, Bigint *b)
879 Bigint *c;
945 /* Convert a Bigint to a double plus an exponent */
948 b2d(Bigint *a, int *e)
982 /* Convert a scaled double to a Bigint plus an exponent. Similar to d2b,
988 Returns a Bigint b and an integer e such that
1003 static Bigint *
1006 Bigint *b;
1052 /* Convert a double to a Bigint plus an exponent. Return NULL on failure.
1054 Given a finite nonzero double d, return an odd Bigint b and exponent *e
1061 static Bigint *
1064 Bigint *b;
1110 ratio(Bigint *a, Bigint *b)
1151 dshift(Bigint *b, int p2)
1159 /* special case of Bigint division. The quotient is always in the range 0 <=
1164 quorem(Bigint *b, Bigint *S)
1301 Bigint *b, *d;
1449 Bigint *bb = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL;
1878 Bigint *bb1 = mult(bs, bb);
2170 sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (unsigned)i;
2204 Bigint *b = (Bigint *)((int *)s - 1);
2291 Bigint *b, *b1, *delta, *mlo, *mhi, *S;