Lines Matching refs:BcBigDig

223 	assert(((BcBigDig) BC_BASE_POW) * 2 == ((BcDig) BC_BASE_POW) * 2);  in bc_num_addDigits()
303 static void bc_num_mulArray(const BcNum *restrict a, BcBigDig b, in bc_num_mulArray()
307 BcBigDig carry = 0; in bc_num_mulArray()
319 BcBigDig in = ((BcBigDig) a->num[i]) * b + carry; in bc_num_mulArray()
347 static void bc_num_divArray(const BcNum *restrict a, BcBigDig b, in bc_num_divArray()
348 BcNum *restrict c, BcBigDig *rem) in bc_num_divArray()
351 BcBigDig carry = 0; in bc_num_divArray()
357 BcBigDig in = ((BcBigDig) a->num[i]) + carry * BC_BASE_POW; in bc_num_divArray()
641 static void bc_num_shift(BcNum *restrict n, BcBigDig dig) { in bc_num_shift()
644 BcBigDig carry = 0, pow; in bc_num_shift()
656 BcBigDig in, temp; in bc_num_shift()
657 in = ((BcBigDig) ptr[i]); in bc_num_shift()
674 BcBigDig dig; in bc_num_shiftLeft()
698 dig = (BcBigDig) (places % BC_BASE_DIGS); in bc_num_shiftLeft()
757 BcBigDig dig; in bc_num_shiftRight()
771 dig = (BcBigDig) (places % BC_BASE_DIGS); in bc_num_shiftRight()
871 static BcBigDig bc_num_intop(const BcNum *a, const BcNum *b, BcNum *restrict c) in bc_num_intop()
1067 BcBigDig sum = 0, carry = 0; in bc_num_m_simp()
1097 sum += ((BcBigDig) ptr_a[j]) * ((BcBigDig) ptr_b[k]); in bc_num_m_simp()
1099 if (sum >= ((BcBigDig) BC_BASE_POW) * BC_BASE_POW) { in bc_num_m_simp()
1308 BcBigDig dig; in bc_num_m()
1312 dig = (BcBigDig) a->num[0]; in bc_num_m()
1316 dig = (BcBigDig) b->num[0]; in bc_num_m()
1450 BcBigDig divisor) in bc_num_divExtend()
1473 BcBigDig divisor; in bc_num_d_long()
1497 divisor = (BcBigDig) b->num[len - 1]; in bc_num_d_long()
1530 divisor = (BcBigDig) b->num[len - 1]; in bc_num_d_long()
1560 BcBigDig result; in bc_num_d_long()
1573 BcBigDig n1, dividend, quotient; in bc_num_d_long()
1577 n1 = (BcBigDig) n[len]; in bc_num_d_long()
1578 dividend = n1 * BC_BASE_POW + (BcBigDig) n[len - 1]; in bc_num_d_long()
1593 bc_num_mulArray(b, (BcBigDig) quotient, &cpb); in bc_num_d_long()
1648 BcBigDig rem; in bc_num_d()
1649 bc_num_divArray(a, (BcBigDig) b->num[0], c, &rem); in bc_num_d()
1824 BcBigDig exp; in bc_num_p()
1923 BcBigDig val; in bc_num_place()
1939 BcBigDig val; in bc_num_left()
1953 BcBigDig val; in bc_num_right()
2112 static BcBigDig bc_num_parseChar(char c, size_t base) { in bc_num_parseChar()
2128 return (BcBigDig) (uchar) c; in bc_num_parseChar()
2195 BcBigDig exp, pow; in bc_num_parseDecimal()
2200 exp = (BcBigDig) i; in bc_num_parseDecimal()
2220 n->num[idx] += (((BcBigDig) c) - '0') * pow; in bc_num_parseDecimal()
2237 BcBigDig base) in bc_num_parseBase()
2242 BcBigDig v; in bc_num_parseBase()
2557 if (bc_num_pow10[i] > (BcBigDig) n->num[idx]) places += 1; in bc_num_printExponent()
2604 bc_num_bigdig2num(&exp, (BcBigDig) places); in bc_num_printExponent()
2626 static void bc_num_printFixup(BcNum *restrict n, BcBigDig rem, in bc_num_printFixup()
2627 BcBigDig pow, size_t idx) in bc_num_printFixup()
2630 BcBigDig acc; in bc_num_printFixup()
2644 acc = ((BcBigDig) a[i]) * rem + ((BcBigDig) a[i - 1]); in bc_num_printFixup()
2651 acc += (BcBigDig) a[i]; in bc_num_printFixup()
2693 static void bc_num_printPrepare(BcNum *restrict n, BcBigDig rem, BcBigDig pow) { in bc_num_printPrepare()
2706 assert(pow == ((BcBigDig) ((BcDig) pow))); in bc_num_printPrepare()
2731 static void bc_num_printNum(BcNum *restrict n, BcBigDig base, size_t len, in bc_num_printNum()
2736 BcBigDig dig = 0, *ptr, acc, exp; in bc_num_printNum()
2792 bc_vec_init(&stack, sizeof(BcBigDig), BC_DTOR_NONE); in bc_num_printNum()
2844 acc = (BcBigDig) intp.num[i]; in bc_num_printNum()
2969 static void bc_num_printBase(BcNum *restrict n, BcBigDig base, bool newline) { in bc_num_printBase()
3071 void bc_num_createFromBigdig(BcNum *restrict n, BcBigDig val) { in bc_num_createFromBigdig()
3116 void bc_num_parse(BcNum *restrict n, const char *restrict val, BcBigDig base) { in bc_num_parse()
3125 BcBigDig dig = bc_num_parseChar(val[0], BC_NUM_MAX_LBASE); in bc_num_parse()
3134 void bc_num_print(BcNum *restrict n, BcBigDig base, bool newline) { in bc_num_print()
3164 BcBigDig bc_num_bigdig2(const BcNum *restrict n) { in bc_num_bigdig2()
3172 BcBigDig r = 0; in bc_num_bigdig2()
3186 r = (BcBigDig) n->num[nrdx + 2]; in bc_num_bigdig2()
3193 r = r * BC_BASE_POW + (BcBigDig) n->num[nrdx + 1]; in bc_num_bigdig2()
3200 r = r * BC_BASE_POW + (BcBigDig) n->num[nrdx]; in bc_num_bigdig2()
3207 BcBigDig bc_num_bigdig(const BcNum *restrict n) { in bc_num_bigdig()
3222 void bc_num_bigdig2num(BcNum *restrict n, BcBigDig val) { in bc_num_bigdig2num()
3373 bc_num_bigdig2num(&conv, (BcBigDig) s2); in bc_num_createFromRNG()
3381 bc_num_bigdig2num(&conv, (BcBigDig) s1); in bc_num_createFromRNG()
3389 bc_num_bigdig2num(&conv, (BcBigDig) i2); in bc_num_createFromRNG()
3397 bc_num_bigdig2num(&conv, (BcBigDig) i1); in bc_num_createFromRNG()
3754 BcBigDig rem; in bc_num_divmod()
3756 bc_num_divArray(ptr_a, (BcBigDig) b->num[0], c, &rem); in bc_num_divmod()