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

Function fxIntegerToBigInt

xs/sources/xsBigInt.c:707–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707txBigInt* fxIntegerToBigInt(txMachine* the, txSlot* slot)
708{
709 txInteger integer = slot->value.integer;
710 txBigInt* bigint = &slot->value.bigint;
711 txU1 sign = 0;
712 if (integer < 0) {
713 integer = -integer;
714 sign = 1;
715 }
716 bigint->data = fxNewChunk(the, sizeof(txU4));
717 bigint->data[0] = (txU4)integer;
718 bigint->sign = sign;
719 bigint->size = 1;
720 slot->kind = XS_BIGINT_KIND;
721 return bigint;
722}
723
724txBigInt* fxNumberToBigInt(txMachine* the, txSlot* slot)
725{

Callers 2

fx_BigIntFunction · 0.85
fxToBigIntFunction · 0.85

Calls 1

fxNewChunkFunction · 0.85

Tested by

no test coverage detected