| 175 | } |
| 176 | |
| 177 | void fx_BigInt_asUintN(txMachine* the) |
| 178 | { |
| 179 | txInteger index = (txInteger)fx_BigInt_asAux(the); |
| 180 | txBigInt* arg = fxToBigInt(the, mxArgv(1), 1); |
| 181 | txBigInt* result; |
| 182 | if (fxBigInt_iszero(arg)) { |
| 183 | result = fxBigInt_dup(the, arg); |
| 184 | } |
| 185 | else { |
| 186 | txBigInt* bits = fxBigInt_ulsl1(the, C_NULL, (txBigInt *)&gxBigIntOne, index); |
| 187 | txBigInt* mask = fxBigInt_sub(the, C_NULL, bits, (txBigInt *)&gxBigIntOne); |
| 188 | result = fxBigInt_uand(the, C_NULL, arg, mask); |
| 189 | if ((arg->sign) && !fxBigInt_iszero(result)) |
| 190 | result = fxBigInt_usub(the, C_NULL, bits, result); |
| 191 | result = fxBigInt_fit(the, result); |
| 192 | } |
| 193 | mxResult->value.bigint = *result; |
| 194 | mxResult->kind = XS_BIGINT_KIND; |
| 195 | // fxToBigInt(the, mxArgv(1), 1); |
| 196 | // mxResult->value.bigint = *fxBigInt_mod(the, C_NULL, &mxArgv(1)->value.bigint, fxBigInt_ulsl1(the, C_NULL, (txBigInt *)&gxBigIntOne, index)); |
| 197 | // mxResult->kind = XS_BIGINT_KIND; |
| 198 | } |
| 199 | |
| 200 | void fx_BigInt_bitLength(txMachine *the) |
| 201 | { |
nothing calls this directly
no test coverage detected