Lines Matching +full:- +full:i
1 /* Extended precision arithmetic functions for long double I/O.
6 #pragma GCC diagnostic ignored "-Wpragmas"
7 #pragma GCC diagnostic ignored "-Wunknown-warning-option"
8 #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
9 #pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"
10 #pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
11 #pragma GCC diagnostic ignored "-Warray-bounds"
12 #pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
42 #define NBITS ((NI-4)*16)
52 /* Maximum exponent digits - base 10 */
170 * Numbers are stored in C language as arrays of 16-bit unsigned
178 * NE-1 significand words (least significant word first,
190 * to ei[NI-2] significand (NI-4 significand words,
193 * ei[NI-1] low guard word (0x8000 bit is rounding place)
212 * -1 if a < b, -2 if either a or b is a NaN.
214 * efloor( a, b, ldp ) truncate to integer, toward -infinity
222 * eneg(e) e = -e
224 * esub( a, b, c, ldp ) c = b - a
235 * eisinf( e ) 1 if e has maximum exponent (non-IEEE)
246 * ecmpm( ai, bi ) compare significands, return 1, 0, or -1
253 * enormlz(ei) left-justify the significand
261 * esubm( ai, bi ) subtract significands, bi = bi - ai
264 * The result is always normalized and rounded to NI-4 word precision
272 * Define NANS for support of Not-a-Number items; otherwise the
275 * If NaN's are supported, the output of ecmp(a,b) is -2 if
277 * may not be legitimate. Use if(ecmp(a,b) == -1) for less-than
289 * 5 Jan 84 PDP-11 assembly language version
292 * 15 May 92 80-bit long double support
338 * For Digital Equipment PDP-11 and VAX computers, certain
339 * IBM systems, and others that use numbers with a 56-bit
347 * Std 754-1985), the symbol IBMPC should be defined. These
348 * numbers have 53-bit significands. In this mode, constants
384 double i; member
415 /* This handles 64-bit long ints. */
472 register int i; in eclear() local
474 for (i = 0; i < NE; i++) in eclear()
488 register int i; in emov() local
490 for (i = 0; i < NE; i++) in emov()
510 x[NE - 1] ^= 0x8000; /* Toggle the sign bit */ in eneg()
526 if (x[NE - 1] & 0x8000) in eisneg()
540 if ((x[NE - 1] & 0x7fff) == 0x7fff) in eisinf()
552 /* Check if e-type number is not a number.
559 int i; in eisnan() local
561 if ((x[NE - 1] & 0x7fff) != 0x7fff) in eisnan()
563 /* ... and non-zero significand field. */ in eisnan()
564 for (i = 0; i < NE - 1; i++) in eisnan()
585 register int i; in einfin() local
588 for (i = 0; i < NE - 1; i++) in einfin()
593 for (i = 0; i < NE - 1; i++) in einfin()
596 if (ldp->rndprc < NBITS) in einfin()
598 if (ldp->rndprc == 113) in einfin()
600 *(x - 9) = 0; in einfin()
601 *(x - 8) = 0; in einfin()
603 if (ldp->rndprc == 64) in einfin()
605 *(x - 5) = 0; in einfin()
607 if (ldp->rndprc == 53) in einfin()
609 *(x - 4) = 0xf800; in einfin()
613 *(x - 4) = 0; in einfin()
614 *(x - 3) = 0; in einfin()
615 *(x - 2) = 0xff00; in einfin()
629 int i; in emovi() local
632 p = a + (NE - 1); /* point to last word of external number */ in emovi()
639 *q = *p--; in emovi()
642 if ((*(q - 1) & 0x7fff) == 0x7fff) in emovi()
648 for (i = 3; i < NI; i++) in emovi()
649 *q++ = *p--; in emovi()
653 for (i = 2; i < NI; i++) in emovi()
661 for (i = 0; i < NE - 1; i++) in emovi()
662 *q++ = *p--; in emovi()
675 unsigned short i; in emovo() local
678 q = b + (NE - 1); /* point to output exponent */ in emovo()
680 i = *p++; in emovo()
681 if (i) in emovo()
682 *q-- = *p++ | 0x8000; in emovo()
684 *q-- = *p++; in emovo()
686 if (*(p - 1) == 0x7fff) in emovo()
702 for (i = 0; i < NE - 1; i++) in emovo()
703 *q-- = *p++; in emovo()
713 register int i; in ecleaz() local
715 for (i = 0; i < NI; i++) in ecleaz()
724 register int i; in ecleazs() local
727 for (i = 0; i < NI - 1; i++) in ecleazs()
739 register int i; in emovz() local
741 for (i = 0; i < NI - 1; i++) in emovz()
753 int i; in eiisnan() local
757 for (i = M + 1; i < NI; i++) in eiisnan()
759 if (x[i] != 0) in eiisnan()
799 ; -1 if a < b
804 int i; in ecmpm() local
808 for (i = M; i < NI; i++) in ecmpm()
816 if (*(--a) > *(--b)) in ecmpm()
819 return (-1); in ecmpm()
831 int i; in eshdn1() local
836 for (i = M; i < NI; i++) in eshdn1()
858 int i; in eshup1() local
860 x += NI - 1; in eshup1()
863 for (i = M; i < NI; i++) in eshup1()
871 --x; in eshup1()
885 int i; in eshdn8() local
889 for (i = M; i < NI; i++) in eshdn8()
906 int i; in eshup8() local
909 x += NI - 1; in eshup8()
912 for (i = M; i < NI; i++) in eshup8()
918 --x; in eshup8()
929 int i; in eshup6() local
935 for (i = M; i < NI - 1; i++) in eshup6()
948 int i; in eshdn6() local
951 x += NI - 1; in eshdn6()
954 for (i = M; i < NI - 1; i++) in eshdn6()
955 *(--p) = *(--x); in eshdn6()
957 *(--p) = 0; in eshdn6()
969 int i; in eaddm() local
972 x += NI - 1; in eaddm()
973 y += NI - 1; in eaddm()
975 for (i = M; i < NI; i++) in eaddm()
983 --x; in eaddm()
984 --y; in eaddm()
990 ; y - x replaces y
997 int i; in esubm() local
1000 x += NI - 1; in esubm()
1001 y += NI - 1; in esubm()
1003 for (i = M; i < NI; i++) in esubm()
1005 a = (unsigned long) (*y) - (unsigned long) (*x) - carry; in esubm()
1011 --x; in esubm()
1012 --y; in esubm()
1020 /* Multiply significand of e-type number b
1021 by 16-bit quantity a, e-type result to c. */
1031 int i; in m16m() local
1034 pp = &p[NI - 2]; in m16m()
1037 ps = &b[NI - 1]; in m16m()
1039 for (i = M + 1; i < NI; i++) in m16m()
1043 --ps; in m16m()
1044 --pp; in m16m()
1045 *(pp - 1) = 0; in m16m()
1049 m = (unsigned long) aa **ps--; in m16m()
1051 *pp-- = (unsigned short) carry; in m16m()
1054 *(pp - 1) = carry >> 16; in m16m()
1057 for (i = M; i < NI; i++) in m16m()
1058 c[i] = p[i]; in m16m()
1069 int i; in edivm() local
1074 unsigned short *equot = ldp->equot; in edivm()
1080 for (i = M; i < NI; i++) in edivm()
1086 for (i = M; i < NI; i++) in edivm()
1100 if( tnum - tcheck > tdenm ) in edivm()
1108 tquot -= 1; in edivm()
1112 tquot -= 1; in edivm()
1135 equot[i] = tquot; in edivm()
1141 for (i = M; i < NI; i++) in edivm()
1148 for (i = 0; i < NI; i++) in edivm()
1149 num[i] = equot[i]; in edivm()
1163 int i; in emulm() local
1164 unsigned short *equot = ldp->equot; in emulm()
1168 for (i = M; i < NI; i++) in emulm()
1169 equot[i] = 0; in emulm()
1172 p = &a[NI - 1]; in emulm()
1173 q = &equot[NI - 1]; in emulm()
1174 for (i = M + 1; i < NI; i++) in emulm()
1178 --p; in emulm()
1182 m16m (*p--, b, pprod); in emulm()
1189 for (i = 0; i < NI; i++) in emulm()
1190 b[i] = equot[i]; in emulm()
1202 int i;
1205 for( i=0; i<NI; i++ )
1217 * This is the so-called sticky bit.
1235 int i, j; in emdnorm() local
1249 exp -= j; in emdnorm()
1262 if (exp > (long) (-NBITS - 1)) in emdnorm()
1265 i = eshift (s, j); in emdnorm()
1266 if (i) in emdnorm()
1279 if (ldp->rndprc != ldp->rlast) in emdnorm()
1281 ecleaz (ldp->rbit); in emdnorm()
1282 switch (ldp->rndprc) in emdnorm()
1286 ldp->rw = NI - 1; /* low guard word */ in emdnorm()
1287 ldp->rmsk = 0xffff; in emdnorm()
1288 ldp->rmbit = 0x8000; in emdnorm()
1289 ldp->rebit = 1; in emdnorm()
1290 ldp->re = ldp->rw - 1; in emdnorm()
1293 ldp->rw = 10; in emdnorm()
1294 ldp->rmsk = 0x7fff; in emdnorm()
1295 ldp->rmbit = 0x4000; in emdnorm()
1296 ldp->rebit = 0x8000; in emdnorm()
1297 ldp->re = ldp->rw; in emdnorm()
1300 ldp->rw = 7; in emdnorm()
1301 ldp->rmsk = 0xffff; in emdnorm()
1302 ldp->rmbit = 0x8000; in emdnorm()
1303 ldp->rebit = 1; in emdnorm()
1304 ldp->re = ldp->rw - 1; in emdnorm()
1308 ldp->rw = 6; in emdnorm()
1309 ldp->rmsk = 0xff; in emdnorm()
1310 ldp->rmbit = 0x80; in emdnorm()
1311 ldp->rebit = 0x100; in emdnorm()
1312 ldp->re = ldp->rw; in emdnorm()
1315 ldp->rw = 6; in emdnorm()
1316 ldp->rmsk = 0x7ff; in emdnorm()
1317 ldp->rmbit = 0x0400; in emdnorm()
1318 ldp->rebit = 0x800; in emdnorm()
1319 ldp->re = ldp->rw; in emdnorm()
1322 ldp->rw = 4; in emdnorm()
1323 ldp->rmsk = 0xff; in emdnorm()
1324 ldp->rmbit = 0x80; in emdnorm()
1325 ldp->rebit = 0x100; in emdnorm()
1326 ldp->re = ldp->rw; in emdnorm()
1329 ldp->rbit[ldp->re] = ldp->rebit; in emdnorm()
1330 ldp->rlast = ldp->rndprc; in emdnorm()
1339 if ((exp <= 0) && (ldp->rndprc != NBITS)) in emdnorm()
1341 if ((exp <= 0) && (ldp->rndprc != 64) && (ldp->rndprc != NBITS)) in emdnorm()
1344 lost |= s[NI - 1] & 1; in emdnorm()
1350 r = s[ldp->rw] & ldp->rmsk; in emdnorm()
1351 if (ldp->rndprc < NBITS) in emdnorm()
1353 i = ldp->rw + 1; in emdnorm()
1354 while (i < NI) in emdnorm()
1356 if (s[i]) in emdnorm()
1358 s[i] = 0; in emdnorm()
1359 ++i; in emdnorm()
1362 s[ldp->rw] &= ~ldp->rmsk; in emdnorm()
1363 if ((r & ldp->rmbit) != 0) in emdnorm()
1365 if (r == ldp->rmbit) in emdnorm()
1369 if ((s[ldp->re] & ldp->rebit) == 0) in emdnorm()
1378 eaddm (ldp->rbit, s); in emdnorm()
1382 if ((exp <= 0) && (ldp->rndprc != NBITS)) in emdnorm()
1384 if ((exp <= 0) && (ldp->rndprc != 64) && (ldp->rndprc != NBITS)) in emdnorm()
1395 s[NI - 1] = 0; in emdnorm()
1403 for (i = 2; i < NI - 1; i++) in emdnorm()
1404 s[i] = 0; in emdnorm()
1408 for (i = M + 1; i < NI - 1; i++) in emdnorm()
1409 s[i] = 0xffff; in emdnorm()
1410 s[NI - 1] = 0; in emdnorm()
1411 if ((ldp->rndprc < 64) || (ldp->rndprc == 113)) in emdnorm()
1413 s[ldp->rw] &= ~ldp->rmsk; in emdnorm()
1414 if (ldp->rndprc == 24) in emdnorm()
1436 ; esub( a, b, c, ldp ); c = b - a
1475 int i, lost, j, k; in eadd1() local
1500 lt = lta - ltb; in eadd1()
1507 lt = -lt; in eadd1()
1512 if (lt < (long) (-NBITS - 1)) in eadd1()
1520 i = ecmpm (ai, bi); in eadd1()
1521 if (i == 0) in eadd1()
1537 for (j = 1; j < NI - 1; j++) in eadd1()
1549 if (i > 0) in eadd1()
1586 int i; in ediv() local
1615 *(c + (NE - 1)) = 0x8000; in ediv()
1617 *(c + (NE - 1)) = 0; in ediv()
1633 for (i = 1; i < NI - 1; i++) in ediv()
1635 if (bi[i] != 0) in ediv()
1637 ltb -= enormlz (bi); in ediv()
1648 for (i = 1; i < NI - 1; i++) in ediv()
1650 if (ai[i] != 0) in ediv()
1652 lta -= enormlz (ai); in ediv()
1657 *(c + (NE - 1)) = 0; in ediv()
1659 *(c + (NE - 1)) = 0x8000; in ediv()
1666 i = edivm (ai, bi, ldp); in ediv()
1668 lt = ltb - lta + EXONE; in ediv()
1669 emdnorm (bi, i, 0, lt, 64, ldp); in ediv()
1692 int i, j; in emul() local
1721 *(c + (NE - 1)) = 0x8000; in emul()
1723 *(c + (NE - 1)) = 0; in emul()
1734 for (i = 1; i < NI - 1; i++) in emul()
1736 if (ai[i] != 0) in emul()
1738 lta -= enormlz (ai); in emul()
1749 for (i = 1; i < NI - 1; i++) in emul()
1751 if (bi[i] != 0) in emul()
1753 ltb -= enormlz (bi); in emul()
1765 lt = lta + ltb - (EXONE - 1); in emul()
1784 int i; in e113toe() local
1801 for (i = 0; i < 7; i++) in e113toe()
1803 if (pe[i] != 0) in e113toe()
1810 for (i = 1; i < 8; i++) in e113toe()
1812 if (pe[i] != 0) in e113toe()
1830 for (i = 0; i < 7; i++) in e113toe()
1831 *p++ = *(--e); in e113toe()
1834 for (i = 0; i < 7; i++) in e113toe()
1845 eshift (yy, -1); in e113toe()
1856 unsigned short i; in toe113() local
1878 i = *p++; in toe113()
1880 if (i) in toe113()
1885 if (i) in toe113()
1886 *q-- = *p++ | 0x8000; in toe113()
1888 *q-- = *p++; in toe113()
1894 for (i = 0; i < 7; i++) in toe113()
1897 for (i = 0; i < 7; i++) in toe113()
1898 *q-- = *p++; in toe113()
1910 int i; in e64toe() local
1915 for (i = 0; i < NE - 5; i++) in e64toe()
1918 for (i = 0; i < 5; i++) in e64toe()
1922 for (i = 0; i < 5; i++) in e64toe()
1926 p = &yy[0] + (NE - 1); in e64toe()
1927 *p-- = *e++; in e64toe()
1929 for (i = 0; i < 4; i++) in e64toe()
1930 *p-- = *e++; in e64toe()
1935 -- but only if the top significand bit is zero. */ in e64toe()
1936 if ((yy[NE - 1] & 0x7fff) == 0 && (yy[NE - 2] & 0x8000) == 0) in e64toe()
1947 p = &yy[NE - 1]; in e64toe()
1952 for (i = 0; i < 4; i++) in e64toe()
1954 if ((i != 3 && pe[i] != 0) in e64toe()
1956 || (i == 3 && pe[i] != 0x8000)) in e64toe()
1964 for (i = 2; i <= 5; i++) in e64toe()
1966 if (pe[i] != 0) in e64toe()
1983 for (i = 0; i < NE; i++) in e64toe()
1993 unsigned short i; in toe64() local
2017 i = *p++; in toe64()
2019 if (i) in toe64()
2025 if (i) in toe64()
2026 *q-- = *p++ | 0x8000; in toe64()
2028 *q-- = *p++; in toe64()
2034 for (i = 0; i < 4; i++) in toe64()
2042 *q-- = 0x8000; in toe64()
2043 *q-- = 0; in toe64()
2044 *q-- = 0; in toe64()
2050 for (i = 0; i < 4; i++) in toe64()
2051 *q-- = *p++; in toe64()
2128 r += EXONE - 01777; in e53toe()
2132 *p++ = *(--e); in e53toe()
2133 *p++ = *(--e); in e53toe()
2134 *p++ = *(--e); in e53toe()
2141 (void) eshift (yy, -5); in e53toe()
2147 yy[E] -= (unsigned short) (k - 1); in e53toe()
2183 unsigned short i; in toe53() local
2205 i = *p++; in toe53()
2206 if (i >= (unsigned int) 2047) in toe53()
2211 *(--y) = 0; in toe53()
2212 *(--y) = 0; in toe53()
2213 *(--y) = 0; in toe53()
2223 *(--y) = 0xffff; in toe53()
2224 *(--y) = 0xffff; in toe53()
2225 *(--y) = 0xffff; in toe53()
2235 if (i == 0) in toe53()
2241 i <<= 4; in toe53()
2244 i |= *p++ & (unsigned short) 0x0f; /* *p = xi[M] */ in toe53()
2245 *y |= (unsigned short) i; /* high order output already has sign bit set */ in toe53()
2247 *(--y) = *p++; in toe53()
2248 *(--y) = *p++; in toe53()
2249 *(--y) = *p; in toe53()
2324 r += EXONE - 0177; in e24toe()
2328 *p++ = *(--e); in e24toe()
2331 *p++ = *(--e); in e24toe()
2337 (void) eshift (yy, -8); in e24toe()
2343 yy[E] -= (unsigned short) (k - 1); in e24toe()
2352 unsigned short i; in toe24() local
2373 i = *p++; in toe24()
2374 if (i >= 255) in toe24()
2379 *(--y) = 0; in toe24()
2382 *(--y) = 0; in toe24()
2391 *(--y) = 0xffff; in toe24()
2394 *(--y) = 0xffff; in toe24()
2403 if (i == 0) in toe24()
2409 i <<= 7; in toe24()
2412 i |= *p++ & (unsigned short) 0x7f; /* *p = xi[M] */ in toe24()
2413 *y |= i; /* high order output already has sign bit set */ in toe24()
2415 *(--y) = *p; in toe24()
2418 *(--y) = *p; in toe24()
2434 * -1 if a < b
2435 * -2 if either a or b is a NaN.
2442 register int i; in ecmp() local
2447 return (-2); in ecmp()
2456 /* -0 equals + 0 */ in ecmp()
2457 for (i = 1; i < NI - 1; i++) in ecmp()
2459 if (ai[i] != 0) in ecmp()
2461 if (bi[i] != 0) in ecmp()
2469 return (-1); in ecmp()
2475 msign = -1; in ecmp()
2476 i = NI - 1; in ecmp()
2484 while (--i > 0); in ecmp()
2492 if (*(--p) > *(--q)) in ecmp()
2495 return (-msign); /* p is littler */ in ecmp()
2515 p = x + NI - 1; in eshift()
2519 sc = -sc; in eshift()
2524 sc -= 16; in eshift()
2531 sc -= 8; in eshift()
2538 sc -= 1; in eshift()
2546 sc -= 16; in eshift()
2552 sc -= 8; in eshift()
2558 sc -= 1; in eshift()
2623 sc -= 8; in enormlz()
2628 sc -= 1; in enormlz()
2630 if (sc < -NBITS) in enormlz()
2681 0x2de3, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */
2683 0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */
2705 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */
2725 {0x2de4, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */
2726 {0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */
2737 {0xcccd, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */
2760 rnd.rlast = -1;
2768 etoasc (w, string, ndigs, -1, ldp);
2805 int i, k; in __ldtoa() local
2816 rnd.rlast = -1; in __ldtoa()
2835 ndigits -= 1; in __ldtoa()
2848 __int32_t expon = (e[NE - 1] & 0x7fff) - (EXONE - 1); /* exponent part */ in __ldtoa()
2877 *decpt = ldp->outexpon + 1; in __ldtoa()
2904 --s; in __ldtoa()
2911 while (*p == ' ' || *p == '-') in __ldtoa()
2918 --s; in __ldtoa()
2923 else if (ndigits > ldp->outexpon) in __ldtoa()
2926 k = ldp->outexpon; in __ldtoa()
2928 while (*(s - 1) == '0' && ((s - outbuf) > k)) in __ldtoa()
2929 *(--s) = '\0'; in __ldtoa()
2931 /* In f format, flush small off-scale values to zero. in __ldtoa()
2933 if (mode == 3 && ((ndigits + ldp->outexpon) < 0)) in __ldtoa()
2943 i = *decpt + orig_ndigits + 3; in __ldtoa()
2945 i = orig_ndigits + MAX_EXP_DIGITS + 4; in __ldtoa()
2947 outstr = __alloc_dtoa_result(i); in __ldtoa()
2955 *rve = outstr + (s - outbuf); in __ldtoa()
2977 rnd.rlast = -1; in _ldcheck()
2990 if ((e[NE - 1] & 0x7fff) == 0x7fff) in _ldcheck()
3010 int i, j, k, expon, rndsav, ndigs; in etoasc() local
3013 unsigned short *equot = ldp->equot; in etoasc()
3016 rndsav = ldp->rndprc; in etoasc()
3025 ldp->rndprc = NBITS; /* set to full precision */ in etoasc()
3027 if (y[NE - 1] & 0x8000) in etoasc()
3030 y[NE - 1] &= 0x7fff; in etoasc()
3040 if (y[NE - 1] == 0) in etoasc()
3042 for (k = 0; k < NE - 1; k++) in etoasc()
3053 if (y[NE - 1] == 0x7fff) in etoasc()
3056 sprintf (string, " -Infinity "); in etoasc()
3066 if ((y[NE - 1] != 0) && ((y[NE - 2] & 0x8000) == 0)) in etoasc()
3075 i = ecmp (eone, y); in etoasc()
3076 if (i == 0) in etoasc()
3079 if (i < 0) in etoasc()
3083 u[NE - 1] = EXONE + NBITS - 1; in etoasc()
3085 p = &etens[NTEN - 4][0]; in etoasc()
3091 for (j = 0; j < NE - 1; j++) in etoasc()
3105 u[NE - 1] += y[NE - 1] - (unsigned int) (EXONE + NBITS - 1); in etoasc()
3128 if (y[NE - 1] == 0) in etoasc()
3130 while ((y[NE - 2] & 0x8000) == 0) in etoasc()
3133 expon -= 1; in etoasc()
3139 for (i = 0; i < ndec + 1; i++) in etoasc()
3141 if ((w[NI - 1] & 0x7) != 0) in etoasc()
3154 if (u[NI - 1] != 0) in etoasc()
3156 if (eone[NE - 1] <= u[1]) in etoasc()
3159 expon -= 1; in etoasc()
3163 k = -MAXP; in etoasc()
3191 digit = equot[NI - 1]; in etoasc()
3200 digit = equot[NI - 1]; in etoasc()
3201 expon -= 1; in etoasc()
3205 *s++ = '-'; in etoasc()
3224 ndigs -= 1; in etoasc()
3248 *s++ = (char) equot[NI - 1] + '0'; in etoasc()
3250 digit = equot[NI - 1]; in etoasc()
3251 --s; in etoasc()
3262 if (ndigs < 0 || (*(s - 1 - (*(s - 1) == '.')) & 1) == 0) in etoasc()
3265 /* Round up and propagate carry-outs */ in etoasc()
3267 --s; in etoasc()
3272 /* This will print like "1E-6". */ in etoasc()
3279 --s; in etoasc()
3305 sprintf (ss, "e-%02d", -expon); in etoasc()
3310 ldp->rndprc = rndsav; in etoasc()
3311 ldp->outexpon = expon; in etoasc()
3330 ; (i.e., "scientific" notation).
3344 rnd.rlast = -1;
3394 rndsav = ldp->rndprc;
3395 ldp->rndprc = NBITS; /* Set to full precision */
3407 k = *s - '0';
3424 --sp;
3426 *sp-- = 'z';
3446 xt[NI - 2] = (unsigned short) k;
3451 /* Mark any lost non-zero digit. */
3455 nexp -= 1;
3473 case '-':
3490 case 'i':
3491 case 'I':
3513 /* check for + or - */
3514 if (*s == '-')
3516 esign = -1;
3524 exp += *s++ - '0';
3534 exp = -exp;
3542 if (exp < -4977)
3550 nexp = exp - nexp;
3561 nexp -= 1;
3569 lexp = (EXONE - 1 + NBITS) - k;
3576 * for 0 <= n <= 324 is 8.2e-20, at 10**180.
3577 * For 0 <= n <= 999, the peak relative error is 1.4e-19 at 10**947.
3578 * For 0 >= n >= -999, it is -1.55e-19 at 10**-435.
3589 nexp = -nexp;
3590 esign = -1;
3594 lexp -= tt[E];
3597 nexp -= 4096;
3607 p -= NE;
3615 lexp -= tt[E];
3623 lexp -= EXONE - 1;
3630 lexp -= EXONE - 0x3ff;
3632 lexp -= EXONE - 0177;
3635 lexp -= EXONE - 0201;
3637 ldp->rndprc = oprec;
3642 ldp->rndprc = rndsav;
3673 lenldstr += s - lstr;
3713 int e, expon, i; in efloor() local
3717 expon = (int) f[NE - 1]; in efloor()
3718 e = (expon & 0x7fff) - (EXONE - 1); in efloor()
3725 e = NBITS - e; in efloor()
3734 e -= 16; in efloor()
3743 for (i = 0; i < NE - 1; i++) in efloor()
3745 if (f[i] != y[i]) in efloor()
3761 unsigned short *equot = ldp->equot; in eiremain()
3764 ld -= enormlz (den); in eiremain()
3766 ln -= enormlz (num); in eiremain()
3780 equot[NI - 1] |= j; in eiremain()
3782 ln -= 1; in eiremain()
3839 int i, n; in enan() local
3867 for (i = 0; i < NE - 2; i++) in enan()
3871 for (i = 0; i < NE - 2; i++) in enan()
3884 for (i = 4; i < NI - 1; i++) in enan()
3888 for (i = 4; i < NI - 1; i++) in enan()
3898 for (i = 0; i < n; i++) in enan()