result = result * 10 */
| 524 | |
| 525 | /* result = result * 10 */ |
| 526 | static void |
| 527 | BigInt_Multiply10(BigInt *result) |
| 528 | { |
| 529 | /* multiply all the blocks */ |
| 530 | npy_uint64 carry = 0; |
| 531 | |
| 532 | npy_uint32 *cur = result->blocks; |
| 533 | npy_uint32 *end = result->blocks + result->length; |
| 534 | for ( ; cur != end; ++cur) { |
| 535 | npy_uint64 product = (npy_uint64)(*cur) * 10ull + carry; |
| 536 | (*cur) = (npy_uint32)(product & bitmask_u64(32)); |
| 537 | carry = product >> 32; |
| 538 | } |
| 539 | |
| 540 | if (carry != 0) { |
| 541 | /* grow the array */ |
| 542 | DEBUG_ASSERT(result->length + 1 <= c_BigInt_MaxBlocks); |
| 543 | *cur = (npy_uint32)carry; |
| 544 | ++result->length; |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | static npy_uint32 g_PowerOf10_U32[] = |
| 549 | { |
no test coverage detected