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

Function fxBigInt_sub

xs/sources/xsBigInt.c:1394–1409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1392}
1393
1394txBigInt *fxBigInt_sub(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb)
1395{
1396 if ((aa->sign ^ bb->sign) == 0) {
1397 if (!aa->sign)
1398 rr = fxBigInt_usub(the, rr, aa, bb);
1399 else
1400 rr = fxBigInt_usub(the, rr, bb, aa);
1401 }
1402 else {
1403 txU1 sign = aa->sign; /* could be replaced if rr=aa */
1404 rr = fxBigInt_uadd(the, rr, aa, bb);
1405 rr->sign = sign;
1406 }
1407 mxBigInt_meter(rr->size);
1408 return(rr);
1409}
1410
1411#if __has_builtin(__builtin_add_overflow)
1412static int fxBigInt_uadd_prim(txU4 *rp, txU4 *ap, txU4 *bp, int an, int bn)

Callers 12

fxBigInt_mod_addFunction · 0.85
fxBigInt_mod_dblFunction · 0.85
fxBigInt_mod_subFunction · 0.85
mont_reductionFunction · 0.85
mont_mulFunction · 0.85
fx_BigInt_asIntNFunction · 0.85
fx_BigInt_asUintNFunction · 0.85
fxBigInt_decFunction · 0.85
fxBigInt_modFunction · 0.85
fxBigInt_udivFunction · 0.85

Calls 2

fxBigInt_usubFunction · 0.85
fxBigInt_uaddFunction · 0.85

Tested by

no test coverage detected