Lines Matching +full:- +full:i
22 AT&T Bell Laboratories, Room 2C-463
24 Murray Hill, NJ 07974-2070
49 n = S->_wds; in quorem()
51 /*debug*/ if (b->_wds > n) in quorem()
54 if (b->_wds < n) in quorem()
56 sx = S->_x; in quorem()
57 sxe = sx + --n; in quorem()
58 bx = b->_x; in quorem()
76 y = (*bx & 0xffff) - (ys & 0xffff) + borrow; in quorem()
79 z = (*bx >> 16) - (zs & 0xffff) + borrow; in quorem()
86 y = *bx - (ys & 0xffff) + borrow; in quorem()
95 bx = b->_x; in quorem()
96 while (--bxe > bx && !*bxe) in quorem()
97 --n; in quorem()
98 b->_wds = n; in quorem()
106 bx = b->_x; in quorem()
107 sx = S->_x; in quorem()
115 y = (*bx & 0xffff) - (ys & 0xffff) + borrow; in quorem()
118 z = (*bx >> 16) - (zs & 0xffff) + borrow; in quorem()
125 y = *bx - (ys & 0xffff) + borrow; in quorem()
132 bx = b->_x; in quorem()
136 while (--bxe > bx && !*bxe) in quorem()
137 --n; in quorem()
138 b->_wds = n; in quorem()
146 * Inspired by "How to Print Floating-Point Numbers Accurately" by
147 * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101].
160 * round-nearest rule will give the same floating-point value
165 * 5. When converting floating-point integers less than 1e16,
166 * we use floating-point arithmetic rather than resorting
167 * to multiple-precision integers.
169 * to get by with floating-point arithmetic; we resort to
170 * multiple-precision integer arithmetic only if we cannot
171 * guarantee that the floating-point calculation has given
174 * something like 10^(k-15) that we must resort to the long
191 to the end of the return value. If d is +-Infinity or NaN, in __dtoa()
207 4-9 should give the same return values as 2-3, i.e., in __dtoa()
211 faster than modes 2-3. in __dtoa()
212 4,5,8,9 ==> left-to-right digit generation. in __dtoa()
213 6-9 ==> don't try fast floating-point estimate in __dtoa()
216 Values of mode other than 0-9 are treated as mode 0. in __dtoa()
222 int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, j, j1, k, k0, in __dtoa() local
284 i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1)); in __dtoa()
286 if ((i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1))) != 0) in __dtoa()
293 if (j = 11 - hi0bits (word0 (d2) & Frac_mask)) in __dtoa()
297 /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 in __dtoa()
299 * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) in __dtoa()
300 * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) in __dtoa()
304 * k = (i - Bias)*0.301029995663981 in __dtoa()
305 * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); in __dtoa()
308 * The error in the first-order Taylor series approximation in __dtoa()
311 * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, in __dtoa()
312 * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, in __dtoa()
313 * adding 1e-13 to the constant term more than suffices. in __dtoa()
319 i -= Bias; in __dtoa()
321 i <<= 2; in __dtoa()
322 i += j; in __dtoa()
331 i = bbits + be + (Bias + (P - 1) - 1); in __dtoa()
333 x = word0 (d) << (32 - i); in __dtoa()
335 x = (i > 32) ? (word0 (d) << (64 - i)) | (word1 (d) >> (i - 32)) in __dtoa()
336 : (word1 (d) << (32 - i)); in __dtoa()
339 word0 (d2) -= 31 * Exp_msk1; /* adjust exponent */ in __dtoa()
340 i -= (Bias + (P - 1) - 1) + 1; in __dtoa()
345 ds = (d2.d - 1.5) * 0.289529651 + 0.176091269 + i * 0.30103001; in __dtoa()
347 ds = (d2.d - 1.5) * 0.289529654602168 + 0.1760912590558 + i * 0.301029995663981; in __dtoa()
351 k--; /* want k = floor(ds) */ in __dtoa()
356 k--; in __dtoa()
359 j = bbits - i - 1; in __dtoa()
367 b2 = -j; in __dtoa()
378 b2 -= k; in __dtoa()
379 b5 = -k; in __dtoa()
387 mode -= 4; in __dtoa()
391 ilim = ilim1 = -1; in __dtoa()
396 i = 18; in __dtoa()
405 ilim = ilim1 = i = ndigits; in __dtoa()
411 i = ndigits + k + 1; in __dtoa()
412 ilim = i; in __dtoa()
413 ilim1 = i - 1; in __dtoa()
414 if (i <= 0) in __dtoa()
415 i = 1; in __dtoa()
417 s = s0 = __alloc_dtoa_result(i); in __dtoa()
425 /* Try to get by with floating-point arithmetic. */ in __dtoa()
427 i = 0; in __dtoa()
439 j &= Bletch - 1; in __dtoa()
440 d.d /= bigtens[n_bigtens - 1]; in __dtoa()
443 for (; j; j >>= 1, i++) in __dtoa()
447 ds *= bigtens[i]; in __dtoa()
451 else if ((j1 = -k) != 0) in __dtoa()
454 for (j = j1 >> 4; j; j >>= 1, i++) in __dtoa()
458 d.d *= bigtens[i]; in __dtoa()
466 k--; in __dtoa()
471 word0 (eps) -= (P - 1) * Exp_msk1; in __dtoa()
475 d.d -= 5.; in __dtoa()
478 if (d.d < -eps.d) in __dtoa()
488 eps.d = 0.5 / tens[ilim - 1] - eps.d; in __dtoa()
489 for (i = 0;;) in __dtoa()
492 d.d -= L; in __dtoa()
496 if (1. - d.d < eps.d) in __dtoa()
498 if (++i >= ilim) in __dtoa()
508 eps.d *= tens[ilim - 1]; in __dtoa()
509 for (i = 1;; i++, d.d *= 10.) in __dtoa()
512 d.d -= L; in __dtoa()
514 if (i == ilim) in __dtoa()
518 else if (d.d < 0.5 - eps.d) in __dtoa()
520 while (*--s == '0'); in __dtoa()
550 for (i = 1;; i++) in __dtoa()
553 d.d -= L * ds; in __dtoa()
558 L--; in __dtoa()
563 if (i == ilim) in __dtoa()
569 while (*--s == '9') in __dtoa()
593 i = in __dtoa()
595 denorm ? be + (Bias + (P - 1) - 1 + 1) : in __dtoa()
598 1 + 4 * P - 3 - bbits + ((bbits + be - 1) & 3); in __dtoa()
600 1 + P - bbits; in __dtoa()
605 j = ilim - 1; in __dtoa()
607 m5 -= j; in __dtoa()
610 s5 += j -= m5; in __dtoa()
614 if ((i = ilim) < 0) in __dtoa()
616 m2 -= i; in __dtoa()
617 i = 0; in __dtoa()
620 b2 += i; in __dtoa()
621 s2 += i; in __dtoa()
626 i = m2 < s2 ? m2 : s2; in __dtoa()
627 b2 -= i; in __dtoa()
628 m2 -= i; in __dtoa()
629 s2 -= i; in __dtoa()
642 if ((j = b5 - m5) != 0) in __dtoa()
681 if ((i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0x1f) != 0) in __dtoa()
682 i = 32 - i; in __dtoa()
684 if ((i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0xf) != 0) in __dtoa()
685 i = 16 - i; in __dtoa()
687 if (i > 4) in __dtoa()
689 i -= 4; in __dtoa()
690 b2 += i; in __dtoa()
691 m2 += i; in __dtoa()
692 s2 += i; in __dtoa()
694 else if (i < 4) in __dtoa()
696 i += 28; in __dtoa()
697 b2 += i; in __dtoa()
698 m2 += i; in __dtoa()
699 s2 += i; in __dtoa()
709 k--; in __dtoa()
722 k = -1 - ndigits; in __dtoa()
735 /* Compute mlo -- check for special case in __dtoa()
742 mhi = Balloc (mhi->_k); in __dtoa()
751 for (i = 1;; i++) in __dtoa()
759 j1 = delta->_sign ? 1 : cmp (b, delta); in __dtoa()
792 { /* possible if i == 1 */ in __dtoa()
801 if (i == ilim) in __dtoa()
814 for (i = 1;; i++) in __dtoa()
817 if (i >= ilim) in __dtoa()
829 while (*--s == '9') in __dtoa()
840 while (*--s == '0'); in __dtoa()