| 1733 | } |
| 1734 | |
| 1735 | txBigInt *fxBigInt_mod(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b) |
| 1736 | { |
| 1737 | txBigInt *q; |
| 1738 | mxBigInt_meter(((a->size - b->size) * (a->size + b->size))); |
| 1739 | if (r == NULL) |
| 1740 | r = fxBigInt_alloc(the, a->sign ? b->size : MIN(a->size, b->size)); |
| 1741 | q = fxBigInt_udiv(the, NULL, a, b, &r); |
| 1742 | if (a->sign) { |
| 1743 | if (!fxBigInt_iszero(r)) |
| 1744 | r = fxBigInt_sub(the, r, b, r); |
| 1745 | } |
| 1746 | fxBigInt_free(the, q); |
| 1747 | mxBigInt_meter(r->size); |
| 1748 | return(r); |
| 1749 | } |
| 1750 | |
| 1751 | txBigInt *fxBigInt_rem(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b) |
| 1752 | { |
no test coverage detected