| 331 | } |
| 332 | |
| 333 | txBoolean fxBigIntCompare(txMachine* the, txBoolean less, txBoolean equal, txBoolean more, txSlot* left, txSlot* right) |
| 334 | { |
| 335 | int result; |
| 336 | txNumber delta = 0; |
| 337 | if (mxBigIntIsNaN(&left->value.bigint)) |
| 338 | return less & more & !equal; |
| 339 | if (right->kind == XS_STRING_KIND) |
| 340 | fxStringToBigInt(the, right, 1); |
| 341 | if ((right->kind != XS_BIGINT_KIND) && (right->kind != XS_BIGINT_X_KIND)) { |
| 342 | fxToNumber(the, right); |
| 343 | result = c_fpclassify(right->value.number); |
| 344 | if (result == C_FP_NAN) |
| 345 | return less & more & !equal; |
| 346 | if (result == C_FP_INFINITE) |
| 347 | return (right->value.number > 0) ? less : more; |
| 348 | delta = right->value.number - c_trunc(right->value.number); |
| 349 | fxNumberToBigInt(the, right); |
| 350 | } |
| 351 | if (mxBigIntIsNaN(&right->value.bigint)) |
| 352 | return less & more & !equal; |
| 353 | result = fxBigInt_comp(&left->value.bigint, &right->value.bigint); |
| 354 | if (result < 0) |
| 355 | return less; |
| 356 | if (result > 0) |
| 357 | return more; |
| 358 | if (delta > 0) |
| 359 | return less; |
| 360 | if (delta < 0) |
| 361 | return more; |
| 362 | return equal; |
| 363 | } |
| 364 | |
| 365 | void fxBigIntDecode(txMachine* the, txSize size) |
| 366 | { |
nothing calls this directly
no test coverage detected