Divide and round down (positive divisor; no overflows) */
| 285 | |
| 286 | /* Divide and round down (positive divisor; no overflows) */ |
| 287 | static inline npy_extint128_t |
| 288 | floordiv_128_64(npy_extint128_t a, npy_int64 b) |
| 289 | { |
| 290 | npy_extint128_t result; |
| 291 | npy_int64 remainder; |
| 292 | char overflow = 0; |
| 293 | assert(b > 0); |
| 294 | result = divmod_128_64(a, b, &remainder); |
| 295 | if (a.sign < 0 && remainder != 0) { |
| 296 | result = sub_128(result, to_128(1), &overflow); |
| 297 | } |
| 298 | return result; |
| 299 | } |
| 300 | |
| 301 | |
| 302 | /* Divide and round up (positive divisor; no overflows) */ |
no test coverage detected