| 522 | */ |
| 523 | |
| 524 | void do_mini_left_shift(decimal_t *dec, int shift, int beg, int last) |
| 525 | { |
| 526 | dec1 *from= dec->buf + ROUND_UP(beg + 1) - 1; |
| 527 | dec1 *end= dec->buf + ROUND_UP(last) - 1; |
| 528 | int c_shift= DIG_PER_DEC1 - shift; |
| 529 | DBUG_ASSERT(from >= dec->buf); |
| 530 | DBUG_ASSERT(end < dec->buf + dec->len); |
| 531 | if (beg % DIG_PER_DEC1 < shift) |
| 532 | *(from - 1)= (*from) / powers10[c_shift]; |
| 533 | for(; from < end; from++) |
| 534 | *from= ((*from % powers10[c_shift]) * powers10[shift] + |
| 535 | (*(from + 1)) / powers10[c_shift]); |
| 536 | *from= (*from % powers10[c_shift]) * powers10[shift]; |
| 537 | } |
| 538 | |
| 539 | |
| 540 | /* |