Lines Matching defs:chunk
57 char* BasecaseFixedLast(digit_t chunk, char* out) {
58 while (chunk != 0) {
61 *(--out) = '0' + (chunk % radix);
63 *(--out) = kConversionChars[chunk % radix];
65 chunk /= radix;
95 // {remainder} is now the current chunk to be written out.
158 digit_t chunk;
159 processor_->DivideSingle(rest, &chunk, dividend, chunk_divisor_);
160 out_ = BasecaseMiddle(chunk, out_);
177 char* ProcessLevel(RecursionLevel* level, Digits chunk, char* out,
446 char* ToStringFormatter::ProcessLevel(RecursionLevel* level, Digits chunk,
449 Digits normalized = chunk;
459 // Step 1: If the chunk is guaranteed to remain smaller than the divisor
463 out = ProcessLevel(level->next_, chunk, out, is_last_on_level);
466 // Step 2: Prepare the chunk.
467 bool allow_inplace_modification = chunk.digits() != digits_.digits();
468 Digits original_chunk = chunk;
469 ShiftedDigits chunk_shifted(chunk, level->leading_zero_shift_,
471 chunk = chunk_shifted;
472 chunk.Normalize();
473 // Check (now precisely) if the chunk is smaller than the divisor.
474 int comparison = Compare(chunk, level->divisor_);
478 // If the chunk is strictly smaller than the divisor, we can process
481 // In case we shifted {chunk} in-place, we must undo that
484 // ...and otherwise undo the {chunk = chunk_shifted} assignment above.
485 chunk = original_chunk;
486 out = ProcessLevel(level->next_, chunk, out, is_last_on_level);
489 // If the chunk is equal to the divisor, we know that the right half
492 // fall through to the generic "chunk > divisor" path below.
503 ScratchDigits left(chunk.len() - level->divisor_.len() + 1);
505 // Step 4: Divide to split {chunk} into {left} and {right}.
506 int inverse_len = chunk.len() - level->divisor_.len();
508 processor_->DivideSchoolbook(left, right, chunk, level->divisor_);
510 processor_->DivideSingle(left, right.digits(), chunk, level->divisor_[0]);
513 ScratchDigits scratch(DivideBarrettScratchSpace(chunk.len()));
514 // The top level only computes its inverse when {chunk.len()} is
517 level->ComputeInverse(processor_, chunk.len());
520 Digits inverse = level->GetInverse(chunk.len());
521 processor_->DivideBarrett(left, right, chunk, level->divisor_, inverse,