Lines Matching refs:k
540 int k, maxwds, sign, wds; member
584 (k) int k; in Balloc() argument
586 (int k)
598 if (k <= Kmax && (rv = freelist[k]))
599 freelist[k] = rv->next;
601 x = 1 << k;
611 if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
622 rv->k = k;
639 if (v->k > Kmax)
647 v->next = freelist[v->k];
648 freelist[v->k] = v;
703 b1 = Balloc(b->k+1);
723 int i, k; local
727 for(k = 0, y = 1; x > y; y <<= 1, k++) ;
729 b = Balloc(k);
733 b = Balloc(k+1);
760 int k = 0; local
763 k = 16;
767 k += 8;
771 k += 4;
775 k += 2;
779 k++;
783 return k;
794 int k; local
807 k = 0;
809 k = 16;
813 k += 8;
817 k += 4;
821 k += 2;
825 k++;
831 return k;
859 int k, wa, wb, wc; local
876 k = a->k;
881 k++;
882 c = Balloc(k);
965 (b, k) Bigint *b; int k; in pow5mult() argument
967 (Bigint *b, int k)
974 if ((i = k & 3))
977 if (!(k >>= 2))
994 if (k & 1) {
999 if (!(k >>= 1))
1022 (b, k) Bigint *b; int k; in lshift() argument
1024 (Bigint *b, int k)
1032 n = k >> 5;
1034 n = k >> 4;
1036 k1 = b->k;
1047 if (k &= 0x1f) {
1048 k1 = 32 - k;
1051 *x1++ = *x << k | z;
1059 if (k &= 0xf) {
1060 k1 = 16 - k;
1063 *x1++ = *x << k & 0xffff | z;
1148 c = Balloc(a->k);
1258 int k; local
1273 k = hi0bits(y);
1274 *e = 32 - k;
1276 if (k < Ebits) {
1277 d0 = Exp_1 | y >> (Ebits - k);
1279 d1 = y << ((32-Ebits) + k) | w >> (Ebits - k);
1283 if (k -= Ebits) {
1284 d0 = Exp_1 | y << k | z >> (32 - k);
1286 d1 = z << k | y >> (32 - k);
1293 if (k < Ebits + 16) {
1295 d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k;
1298 d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k;
1303 k -= Ebits + 16;
1304 d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k;
1306 d1 = w << k + 16 | y << k;
1328 int de, k; local
1362 if ((k = lo0bits(&y))) {
1363 x[0] = y | z << (32 - k);
1364 z >>= k;
1374 k = lo0bits(&z);
1380 k += 32;
1384 if (k = lo0bits(&y))
1385 if (k >= 16) {
1386 x[0] = y | z << 32 - k & 0xffff;
1387 x[1] = z >> k - 16 & 0xffff;
1388 x[2] = z >> k;
1393 x[1] = y >> 16 | z << 16 - k & 0xffff;
1394 x[2] = z >> k & 0xffff;
1395 x[3] = z >> k+16;
1411 k = lo0bits(&z);
1412 if (k >= 16) {
1421 k += 32;
1431 *e = (de - Bias - (P-1) << 2) + k;
1432 *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask);
1434 *e = de - Bias - (P-1) + k;
1435 *bits = P - k;
1440 *e = de - Bias - (P-1) + 1 + k;
1462 int k, ka, kb; local
1467 k = ka - kb + 32*(a->wds - b->wds);
1469 k = ka - kb + 16*(a->wds - b->wds);
1472 if (k > 0) {
1473 word0(&da) += (k >> 2)*Exp_msk1;
1474 if (k &= 3)
1475 dval(&da) *= 1 << k;
1478 k = -k;
1479 word0(&db) += (k >> 2)*Exp_msk1;
1480 if (k &= 3)
1481 dval(&db) *= 1 << k;
1484 if (k > 0)
1485 word0(&da) += k*Exp_msk1;
1487 k = -k;
1488 word0(&db) += k*Exp_msk1;
1719 b1 = Balloc(b->k+1);
1735 rshift(b, k) Bigint *b; int k; in rshift() argument
1737 rshift(Bigint *b, int k)
1744 n = k >> kshift;
1748 if (k &= kmask) {
1749 n = 32 - k;
1750 y = *x++ >> k;
1753 y = *x++ >> k;
1768 any_on(b, k) Bigint *b; int k; in any_on() argument
1770 any_on(Bigint *b, int k)
1778 n = k >> kshift;
1781 else if (n < nwds && (k &= kmask)) {
1783 x1 >>= k;
1784 x1 <<= k;
1815 int big, denorm, esign, havedig, k, n, nbits, up, zret; local
1982 for(k = 0; n > (1 << (kshift-2)) - 1; n >>= 1)
1983 k++;
1984 b = Balloc(k);
2019 k = n - 1;
2020 if (x[k>>kshift] & 1 << (k & kmask)) {
2022 if (k > 0 && any_on(b,k))
2075 k = n - 1;
2078 else if (k > 0)
2079 lostbits = any_on(b,k);
2080 if (x[k>>kshift] & 1 << (k & kmask))
2103 k = b->wds;
2113 else if (b->wds > k
2115 && hi0bits(x[k-1]) < 32-n)) {
2131 k = b->x[0] & ((1 << j) - 1);
2133 if (k) {
2145 if (k & j && ((k & (j-1)) | lostbits))
2543 int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign; local
2773 k = nd < DBL_DIG + 2 ? nd : DBL_DIG + 2;
2775 if (k > 9) {
2777 if (k > DBL_DIG)
2780 dval(&rv) = tens[k - 9] * dval(&rv) + z;
2855 e1 += nd - k;
2860 if (k <= DBL_DIG)
3038 bd = Balloc(bd0->k);
3625 int j, k, *r; local
3628 for(k = 0;
3631 k++;
3632 r = (int*)Balloc(k);
3633 *r = k;
3671 b->maxwds = 1 << (b->k = *(int*)b);
3757 j, j1 = 0, k, k0, k_check, leftright, m2, m5, s2, s5, local
3901 k = (int)ds;
3902 if (ds < 0. && ds != k)
3903 k--; /* want k = floor(ds) */
3905 if (k >= 0 && k <= Ten_pmax) {
3906 if (dval(&u) < tens[k])
3907 k--;
3919 if (k >= 0) {
3921 s5 = k;
3922 s2 += k;
3925 b2 -= k;
3926 b5 = -k;
3965 i = ndigits + k + 1;
3984 k0 = k;
3987 if (k > 0) {
3988 ds = tens[k&0xf];
3989 j = k >> 4;
4003 else if ((j1 = -k)) {
4015 k--;
4088 k = k0;
4094 if (be >= 0 && k <= Int_max) {
4096 ds = tens[k];
4138 k++;
4228 k--;
4239 k = -1 - ndigits;
4244 k++;
4257 mhi = Balloc(mhi->k);
4383 k++;
4417 *decpt = k + 1;