| 308 | } |
| 309 | |
| 310 | void fx_Math_idiv(txMachine* the) |
| 311 | { |
| 312 | txInteger x = (mxArgc > 0) ? fxToInteger(the, mxArgv(0)) : 0; |
| 313 | txInteger y = (mxArgc > 1) ? fxToInteger(the, mxArgv(1)) : 0; |
| 314 | if (y == 0) { |
| 315 | mxResult->kind = XS_NUMBER_KIND; |
| 316 | mxResult->value.number = C_NAN; |
| 317 | } |
| 318 | else { |
| 319 | mxResult->kind = XS_INTEGER_KIND; |
| 320 | #if mxIntegerDivideOverflowException |
| 321 | if ((x == (txInteger)0x80000000) && (y == -1)) |
| 322 | mxResult->value.integer = x; |
| 323 | else |
| 324 | #endif |
| 325 | mxResult->value.integer = x / y; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | void fx_Math_idivmod(txMachine* the) |
| 330 | { |
nothing calls this directly
no test coverage detected