Changeset 31360 in project


Ignore:
Timestamp:
09/10/14 15:39:42 (5 years ago)
Author:
sjamaan
Message:

numbers: Make scan check a little more straightforward, hopefully

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/numbers/trunk/numbers-c.c

    r31359 r31360  
    22422242    steps++;
    22432243
    2244   /* Back down: we overshot in the loop */
    2245   base /= radix;
     2244  base /= radix; /* Back down: we overshot in the loop */
    22462245
    22472246  while (start <= scan) {
    2248     if (*scan == 0) {
    2249       scan--;
    2250     } else {
    2251       large_digit = bignum_digits_destructive_scale_down(start, scan, base);
    2252 
    2253       for(i = 0; i < steps; ++i) {
    2254         digit = large_digit % radix;
    2255         large_digit /= radix;
    2256         *index-- = characters[digit];
    2257       }
     2247    large_digit = bignum_digits_destructive_scale_down(start, scan, base);
     2248
     2249    if (*scan == 0) scan--; /* Adjust if we exhausted the highest digit */
     2250
     2251    for(i = 0; i < steps; ++i) {
     2252      digit = large_digit % radix;
     2253      large_digit /= radix;
     2254      *index-- = characters[digit];
    22582255    }
    22592256  }
Note: See TracChangeset for help on using the changeset viewer.