1572 int bb2, bb5, bbe, bd2, bd5, bbbits, bs2,
c, dsign,
1573 e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0,
sign;
1574 const char *s, *s0, *s1;
1575 double aadj, aadj1, adj, rv, rv0;
1579 Bigint *bb = NULL, *bd = NULL, *bs = NULL, *delta = NULL;
1590 const char decimal_point =
'.';
1592 sign = nz0 = nz = 0;
1596 for(s = s00; isspace(
uchar(*s)); s++)
1602 }
else if (*s ==
'+') {
1613 while(*++s ==
'0') ;
1619 for(nd = nf = 0; (c = *s) >=
'0' && c <=
'9'; nd++, s++)
1625 if (c == decimal_point) {
1628 for(; c ==
'0'; c = *++s)
1630 if (c >
'0' && c <=
'9') {
1638 for(; c >=
'0' && c <=
'9'; c = *++s) {
1643 for(i = 1; i < nz; i++)
1658 if (c ==
'e' || c ==
'E') {
1659 if (!nd && !nz && !nz0) {
1671 if (c >=
'0' && c <=
'9') {
1674 if (c >
'0' && c <=
'9') {
1677 while((c = *++s) >=
'0' && c <=
'9')
1679 if (s - s1 > 8 || L > 19999)
1712 #if defined(Q_OS_IRIX) && defined(Q_CC_GNU) 1715 double *t = (
double *)
tens;
1716 rv = t[k - 9] * rv + z;
1719 rv =
tens[k - 9] * rv + z;
1724 #ifndef RND_PRODQUOT
1733 goto vax_ovfl_check;
1763 #ifndef Inaccurate_Divide 1775 if ((i = e1 & 15) != 0)
1778 if (e1 > DBL_MAX_10_EXP) {
1800 for(j = 0; e1 > 1; j++, e1 >>= 1)
1823 if ((i = e1 & 15) != 0)
1829 for(j = 0; e1 > 1; j++, e1 >>= 1)
1863 bd0 =
s2b(s0, nd0, nd, y);
1868 bb =
d2b(rv, &bbe, &bbbits);
1884 #ifdef Sudden_Underflow 1886 j = 1 + 4*
P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
1891 i = bbe + bbbits - 1;
1899 i = bb2 < bd2 ? bb2 : bd2;
1921 delta =
diff(bb, bd);
1922 dsign = delta->sign;
1932 if (
cmp(delta, bs) > 0)
1955 #ifdef Sudden_Underflow 1975 #ifndef ROUND_BIASED 1981 #ifndef ROUND_BIASED 1984 #ifndef Sudden_Underflow 1992 if ((aadj =
ratio(delta, bs)) <= 2.) {
1996 #ifndef Sudden_Underflow 2007 if (aadj < 2./FLT_RADIX)
2008 aadj = 1./FLT_RADIX;
2016 aadj1 = dsign ? aadj : -aadj;
2017 #ifdef Check_FLT_ROUNDS 2018 switch(FLT_ROUNDS) {
2027 if (FLT_ROUNDS == 0)
2038 adj = aadj1 *
ulp(rv);
2052 #ifdef Sudden_Underflow 2056 adj = aadj1 *
ulp(rv);
2059 if ((
getWord0(rv) & Exp_mask) <
P*Exp_msk1)
2061 if ((
getWord0(rv) & Exp_mask) <=
P*Exp_msk1)
2075 adj = aadj1 *
ulp(rv);
2086 if (y <= (
P-1)*Exp_msk1 && aadj >= 1.) {
2087 aadj1 = int(aadj + 0.5);
2091 adj = aadj1 *
ulp(rv);
2102 if (aadj < .4999999 || aadj > .5000001)
2105 else if (aadj < .4999999/FLT_RADIX)
2123 return sign ? -rv : rv;