@@ -37,6 +37,7 @@ struct bn
3737
3838This is the public / exported API:
3939``` C
40+ /* Initialization functions: */
4041void bignum_init (struct bn* n); /* n gets zero-initialized * /
4142void bignum_from_int(struct bn* n, DTYPE_TMP i);
4243int bignum_to_int(struct bn* n);
@@ -49,6 +50,7 @@ void bignum_sub(struct bn* a, struct bn* b, struct bn* c); /* c = a - b */
4950void bignum_mul(struct bn* a, struct bn* b, struct bn* c); /* c = a * b * /
5051void bignum_div(struct bn* a, struct bn* b, struct bn* c); /* c = a / b * /
5152void bignum_mod(struct bn* a, struct bn* b, struct bn* c); /* c = a % b * /
53+ void bignum_divmod(struct bn* a, struct bn* b, struct bn* c, struct bn* d); /* c = a/b, d = a%b * /
5254
5355/* Bitwise operations: * /
5456void bignum_and(struct bn* a, struct bn* b, struct bn* c); /* c = a & b * /
@@ -63,6 +65,7 @@ int bignum_is_zero(struct bn* n); /* For comparison wit
6365void bignum_inc(struct bn* n); /* Increment: add one to n * /
6466void bignum_dec(struct bn* n); /* Decrement: subtract one from n * /
6567void bignum_pow(struct bn* a, struct bn* b, struct bn* c); /* Calculate a^b -- e.g. 2^10 => 1024 * /
68+ void bignum_isqrt(struct bn* a, struct bn* b); /* Integer square root -- e.g. isqrt(5) => 2 * /
6669void bignum_assign(struct bn* dst, struct bn* src); /* Copy src into dst -- dst := src * /
6770```
6871
0 commit comments