• Home
  • Raw
  • Download

Lines Matching refs:BcBigDig

124 	assert(((BcBigDig) BC_BASE_POW) * 2 == ((BcDig) BC_BASE_POW) * 2);  in bc_num_addDigits()
183 static BcStatus bc_num_mulArray(const BcNum *restrict a, BcBigDig b, in bc_num_mulArray()
187 BcBigDig carry = 0; in bc_num_mulArray()
196 BcBigDig in = ((BcBigDig) a->num[i]) * b + carry; in bc_num_mulArray()
217 static BcStatus bc_num_divArray(const BcNum *restrict a, BcBigDig b, in bc_num_divArray()
218 BcNum *restrict c, BcBigDig *rem) in bc_num_divArray()
221 BcBigDig carry = 0; in bc_num_divArray()
226 BcBigDig in = ((BcBigDig) a->num[i]) + carry * BC_BASE_POW; in bc_num_divArray()
414 static BcStatus bc_num_shift(BcNum *restrict n, BcBigDig dig) { in bc_num_shift()
417 BcBigDig carry = 0, pow; in bc_num_shift()
426 BcBigDig in, temp; in bc_num_shift()
427 in = ((BcBigDig) ptr[i]); in bc_num_shift()
441 BcBigDig dig; in bc_num_shiftLeft()
456 dig = (BcBigDig) (places % BC_BASE_DIGS); in bc_num_shiftLeft()
498 BcBigDig dig; in bc_num_shiftRight()
509 dig = (BcBigDig) (places % BC_BASE_DIGS); in bc_num_shiftRight()
563 BcBigDig *v) in bc_num_intop()
704 BcBigDig sum = 0, carry = 0; in bc_num_m_simp()
722 sum += ((BcBigDig) ptr_a[j]) * ((BcBigDig) ptr_b[k]); in bc_num_m_simp()
724 if (sum >= ((BcBigDig) BC_BASE_POW) * BC_BASE_POW) { in bc_num_m_simp()
881 BcBigDig dig; in bc_num_m()
884 dig = (BcBigDig) a->num[0]; in bc_num_m()
888 dig = (BcBigDig) b->num[0]; in bc_num_m()
963 BcBigDig divisor) in bc_num_divExtend()
980 BcBigDig divisor; in bc_num_d_long()
997 divisor = (BcBigDig) b->num[len - 1]; in bc_num_d_long()
1015 divisor = (BcBigDig) b->num[len - 1]; in bc_num_d_long()
1037 BcBigDig q, result; in bc_num_d_long()
1051 BcBigDig n1, dividend; in bc_num_d_long()
1053 n1 = (BcBigDig) n[len]; in bc_num_d_long()
1054 dividend = n1 * BC_BASE_POW + (BcBigDig) n[len - 1]; in bc_num_d_long()
1066 s = bc_num_mulArray(b, (BcBigDig) q, &cpb); in bc_num_d_long()
1113 BcBigDig rem; in bc_num_d()
1114 s = bc_num_divArray(a, (BcBigDig) b->num[0], c, &rem); in bc_num_d()
1221 BcBigDig pow = 0; in bc_num_p()
1303 BcBigDig val = 0; in bc_num_place()
1319 BcBigDig val = 0; in bc_num_left()
1333 BcBigDig val = 0; in bc_num_right()
1412 static BcBigDig bc_num_parseChar(char c, size_t base_t) { in bc_num_parseChar()
1420 return (BcBigDig) (uchar) c; in bc_num_parseChar()
1460 BcBigDig exp, pow; in bc_num_parseDecimal()
1464 exp = (BcBigDig) i; in bc_num_parseDecimal()
1477 n->num[idx] += (((BcBigDig) c) - '0') * pow; in bc_num_parseDecimal()
1487 BcBigDig base) in bc_num_parseBase()
1493 BcBigDig v; in bc_num_parseBase()
1671 if (bc_num_pow10[i] > (BcBigDig) n->num[idx]) places += 1; in bc_num_printExponent()
1701 bc_num_bigdig2num(&exp, (BcBigDig) places); in bc_num_printExponent()
1711 static BcStatus bc_num_printFixup(BcNum *restrict n, BcBigDig rem, in bc_num_printFixup()
1712 BcBigDig pow, size_t idx) in bc_num_printFixup()
1715 BcBigDig acc; in bc_num_printFixup()
1722 acc = ((BcBigDig) a[i]) * rem + ((BcBigDig) a[i - 1]); in bc_num_printFixup()
1725 acc += (BcBigDig) a[i]; in bc_num_printFixup()
1749 static BcStatus bc_num_printPrepare(BcNum *restrict n, BcBigDig rem, in bc_num_printPrepare()
1750 BcBigDig pow) in bc_num_printPrepare()
1762 assert(pow == ((BcBigDig) ((BcDig) pow))); in bc_num_printPrepare()
1781 static BcStatus bc_num_printNum(BcNum *restrict n, BcBigDig base, in bc_num_printNum()
1787 BcBigDig dig = 0, *ptr, acc, exp; in bc_num_printNum()
1832 bc_vec_init(&stack, sizeof(BcBigDig), NULL); in bc_num_printNum()
1864 acc = (BcBigDig) intp.num[i]; in bc_num_printNum()
1948 static BcStatus bc_num_printBase(BcNum *restrict n, BcBigDig base) { in bc_num_printBase()
1975 BcStatus bc_num_stream(BcNum *restrict n, BcBigDig base) { in bc_num_stream()
2014 void bc_num_createFromBigdig(BcNum *n, BcBigDig val) { in bc_num_createFromBigdig()
2048 BcBigDig base, bool letter) in bc_num_parse()
2057 BcBigDig dig = bc_num_parseChar(val[0], BC_NUM_MAX_LBASE); in bc_num_parse()
2066 BcStatus bc_num_print(BcNum *restrict n, BcBigDig base, bool newline) { in bc_num_print()
2088 BcStatus bc_num_bigdig(const BcNum *restrict n, BcBigDig *result) { in bc_num_bigdig()
2091 BcBigDig r; in bc_num_bigdig()
2099 BcBigDig prev = r * BC_BASE_POW; in bc_num_bigdig()
2104 r = prev + (BcBigDig) n->num[--i]; in bc_num_bigdig()
2114 void bc_num_bigdig2num(BcNum *restrict n, BcBigDig val) { in bc_num_bigdig2num()
2343 BcBigDig rem; in bc_num_divmod()
2345 s = bc_num_divArray(ptr_a, (BcBigDig) b->num[0], c, &rem); in bc_num_divmod()