Lines Matching defs:digits
5266 // smallest number of digits so that parsing the resultant string will recover
5482 // The precision argument controls the number of digits rendered, excluding the
5484 // - for "%e" and "%f" it is the number of digits after the decimal separator,
5485 // - for "%g" it is the number of significant digits (and trailing zeroes are
5548 // It assumes that the src bytes are two hexadecimal digits (0-9, A-F, a-f),
5565 // digits (0-9, A-F, a-f), repeated. It may write nonsense bytes if not,
12362 // new digits created after multiplying a positive integer by (1 << i): the
12366 // existing digits may have changed).
12368 // Shifting by i can add either N or N-1 new digits, depending on whether the
12373 // digits, depending on a lexicographic comparison to (5 ** 4), i.e. "625":
12378 // - ("625" << 4) is "10000", which adds 2 new digits.
12379 // - ("625001" << 4) is "10000016", which adds 2 new digits.
12380 // - ("7008" << 4) is "112128", which adds 2 new digits.
12381 // - ("99" << 4) is "1584", which adds 2 new digits.
12390 // possible number of new digits. The low 11 bits are an offset into the
13238 // "High precision" means that the mantissa holds 800 decimal digits. 800 is
13249 // digits[.. num_digits] are the number's digits in big-endian order. The
13253 // decimal_point is the index (within digits) of the decimal point. It may be
13254 // negative or be larger than num_digits, in which case the explicit digits are
13257 // For example, if num_digits is 3 and digits is "\x07\x08\x09":
13273 // WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION digits, and at
13274 // least one of those extra digits are non-zero. The existence of long-tail
13275 // digits can affect rounding.
13283 uint8_t digits[WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION];
13287 // zeroes from the h->digits[.. h->num_digits] slice. They have no benefit,
13295 while ((h->num_digits > 0) && (h->digits[h->num_digits - 1] == 0)) {
13312 // Set h->digits.
13314 // Calculate the digits, working right-to-left. After we determine n (how
13315 // many digits there are), copy from buf to h->digits.
13317 // UINT64_MAX, 18446744073709551615, is 20 digits long. It can be faster to
13331 memcpy(h->digits, ptr, 20);
13389 // Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
13426 h->digits[nd++] = (uint8_t)(*p - '0');
13436 h->digits[nd++] = (uint8_t)(*p - '0');
13479 h->digits[nd++] = (uint8_t)(*p - '0');
13483 h->digits[nd++] = (uint8_t)(*p - '0');
13569 // returns the number of additional decimal digits when left-shifting by shift.
13594 } else if (h->digits[i] == pow5[i]) {
13596 } else if (h->digits[i] < pow5[i]) {
13609 // decimal digits. For 19 or more digits, it returns UINT64_MAX. Note that:
13610 // - (1 << 53) is 9007199254740992, which has 16 decimal digits.
13611 // - (1 << 56) is 72057594037927936, which has 17 decimal digits.
13612 // - (1 << 59) is 576460752303423488, which has 18 decimal digits.
13613 // - (1 << 63) is 9223372036854775808, which has 19 decimal digits.
13634 n = (10 * n) + ((i < h->num_digits) ? h->digits[i] : 0);
13639 round_up = h->digits[dp] >= 5;
13640 if ((h->digits[dp] == 5) && (dp + 1 == h->num_digits)) {
13644 ((dp > 0) && (1 & h->digits[dp - 1]));
13694 n += ((uint64_t)(h->digits[rx])) << shift;
13698 h->digits[wx] = (uint8_t)rem;
13707 // Put down leading digits, right to left.
13712 h->digits[wx] = (uint8_t)rem;
13738 // Pick up enough leading digits to cover the first shift.
13742 n = (10 * n) + h->digits[rx++];
13769 n = (10 * (n & mask)) + h->digits[rx++];
13770 h->digits[wx++] = new_digit;
13773 // Put down trailing digits, left to right.
13778 h->digits[wx++] = new_digit;
13816 // most n digits (which is not necessarily at most n decimal places). Negative
13818 // of digits. The etc__round_just_enough function implicitly chooses an n to
13848 if (h->digits[n] < 9) {
13849 h->digits[n]++;
13856 h->digits[0] = 1;
13868 bool up = h->digits[n] >= 5;
13869 if ((h->digits[n] == 5) && ((n + 1) == ((int32_t)(h->num_digits)))) {
13871 ((n > 0) && ((h->digits[n - 1] & 1) != 0));
13945 // As we walk the digits, we want to know whether rounding up would fall
13947 // - When -1, the digits of h and upper are the same so far.
13958 // We can now figure out the shortest number of digits required. Walk the
13959 // digits until h has distinguished itself from lower or upper.
13961 // The zi and zd variables are indexes and digits, for z in l (lower), h (the
13974 uint8_t hd = (((uint32_t)hi) < h->num_digits) ? h->digits[hi] : 0;
13978 uint8_t ld = (((uint32_t)li) < lower.num_digits) ? lower.digits[li] : 0;
13988 uint8_t ud = (((uint32_t)ui) < upper.num_digits) ? upper.digits[ui] : 0;
14370 man = (10 * man) + h->digits[i];
14413 if (h->digits[0] >= 5) {
14416 shift = (h->digits[0] < 2) ? 2 : 1;
14564 // can be a sequence of decimal digits.
14605 // Count the number of digits:
14660 // - (1 << 63) is 9223372036854775808, which has 19 decimal digits.
14661 // - (1 << 64) is 18446744073709551616, which has 20 decimal digits.
14663 // bits and 16 hexadecimal digits.
14665 // bits and 17 hexadecimal digits.
14667 // Even if we have more than 19 pseudo-digits, it's not yet definitely an
14670 // meaningful digits if the input looks something like "0.000dddExxx".
14815 // Integral digits.
14823 *ptr++ = (uint8_t)('0' | h->digits[i]);
14830 // Separator and then fractional digits.
14839 *ptr++ = (uint8_t)('0' | ((j < h->num_digits) ? h->digits[j] : 0));
14889 *ptr++ = (uint8_t)('0' | h->digits[0]);
14894 // Separator and then fractional digits.
14903 *ptr++ = (uint8_t)('0' | h->digits[i]);
14910 // Exponent: "e±" and then 2 or 3 digits.
14999 // digits, not the number of digits after the decimal separator. Perform
15047 // wuffs_base__parse_number__foo_digits entries are 0x00 for invalid digits,
15048 // and (0x80 | v) for valid digits, where v is the 4 bit value.