MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxBigInt_rem

Function fxBigInt_rem

xs/sources/xsBigInt.c:1751–1769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1749}
1750
1751txBigInt *fxBigInt_rem(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b)
1752{
1753 txBigInt *q;
1754#ifndef mxCompile
1755 if (fxBigInt_iszero(b))
1756 mxRangeError("zero divider");
1757#endif
1758 mxBigInt_meter(((a->size - b->size) * (a->size + b->size)));
1759 if (r == NULL)
1760 r = fxBigInt_alloc(the, MIN(a->size, b->size));
1761 q = fxBigInt_udiv(the, NULL, a, b, &r);
1762 if (a->sign) {
1763 if (!fxBigInt_iszero(r))
1764 r->sign = !r->sign;
1765 }
1766 fxBigInt_free(the, q);
1767 mxBigInt_meter(r->size);
1768 return(r);
1769}
1770
1771static void fxBigInt_makepoly(txBigInt *r, txBigInt *a, int t)
1772{

Callers

nothing calls this directly

Calls 4

fxBigInt_iszeroFunction · 0.85
fxBigInt_allocFunction · 0.85
fxBigInt_udivFunction · 0.85
fxBigInt_freeFunction · 0.85

Tested by

no test coverage detected