- for (p = first_digit, count = number_of_digits_to_use;
- count;
- p ++, -- count)
- {
- c = * p;
- if (isdigit(c))
- {
- /*
- * Multiply by 10. Assume can never overflow.
- * Add this digit to digits_binary_low[].
- */
-
- long carry;
- LITTLENUM_TYPE * littlenum_pointer;
- LITTLENUM_TYPE * littlenum_limit;
-
- littlenum_limit
- = digits_binary_low
- + more_than_enough_littlenums_for_digits
- - 1;
- carry = c - '0'; /* char -> binary */
- for (littlenum_pointer = digits_binary_low;
- littlenum_pointer <= littlenum_limit;
- littlenum_pointer ++)
- {
- long work;
-
- work = carry + 10 * (long)(*littlenum_pointer);
- * littlenum_pointer = work & LITTLENUM_MASK;
- carry = work >> LITTLENUM_NUMBER_OF_BITS;
- }
- if (carry != 0)
- {
- /*
- * We have a GROSS internal error.
- * This should never happen.
- */
- abort(); /* RMS prefers abort() to any message. */
- }
- }
- else
- {
- ++ count; /* '.' doesn't alter digits used count. */
- } /* if valid digit */
- } /* for each digit */
- }
+ /*
+ * Parse the decimal digits as if * digits_low was in the units position.
+ * Emit a binary number into digits_binary_low[].
+ *
+ * Use a large-precision version of:
+ * (((1st-digit) * 10 + 2nd-digit) * 10 + 3rd-digit ...) * 10 + last-digit
+ */
+
+ for (p = first_digit, count = number_of_digits_to_use; count; p++, --count)
+ {
+ c = *p;
+ if (ISDIGIT (c))
+ {
+ /*
+ * Multiply by 10. Assume can never overflow.
+ * Add this digit to digits_binary_low[].
+ */
+
+ long carry;
+ LITTLENUM_TYPE *littlenum_pointer;
+ LITTLENUM_TYPE *littlenum_limit;
+
+ littlenum_limit = digits_binary_low
+ + more_than_enough_littlenums_for_digits
+ - 1;
+
+ carry = c - '0'; /* char -> binary */
+
+ for (littlenum_pointer = digits_binary_low;
+ littlenum_pointer <= littlenum_limit;
+ littlenum_pointer++)
+ {
+ long work;
+
+ work = carry + 10 * (long) (*littlenum_pointer);
+ *littlenum_pointer = work & LITTLENUM_MASK;
+ carry = work >> LITTLENUM_NUMBER_OF_BITS;
+ }
+
+ if (carry != 0)
+ {
+ /*
+ * We have a GROSS internal error.
+ * This should never happen.
+ */
+ as_fatal (_("failed sanity check"));
+ }
+ }
+ else
+ {
+ ++count; /* '.' doesn't alter digits used count. */
+ }
+ }