| 332 | } |
| 333 | |
| 334 | void fx_Math_imod(txMachine* the) |
| 335 | { |
| 336 | txInteger x = (mxArgc > 0) ? fxToInteger(the, mxArgv(0)) : 0; |
| 337 | txInteger y = (mxArgc > 1) ? fxToInteger(the, mxArgv(1)) : 0; |
| 338 | if (y == 0) { |
| 339 | mxResult->kind = XS_NUMBER_KIND; |
| 340 | mxResult->value.number = C_NAN; |
| 341 | } |
| 342 | else { |
| 343 | mxResult->kind = XS_INTEGER_KIND; |
| 344 | #if mxIntegerDivideOverflowException |
| 345 | if ((x == (txInteger)0x80000000) && (y == -1)) |
| 346 | mxResult->value.integer = 0; |
| 347 | else |
| 348 | #endif |
| 349 | mxResult->value.integer = (x % y + y) % y; |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | void fx_Math_imul(txMachine* the) |
| 354 | { |
nothing calls this directly
no test coverage detected