Lines Matching refs:DIG_PER_DEC1

125 #define DIG_PER_DEC1 9  macro
130 static const dec1 powers10[DIG_PER_DEC1+1]={
132 static const int dig2bytes[DIG_PER_DEC1+1]={0, 1, 1, 2, 2, 3, 3, 4, 4, 4};
133 static const dec1 frac_max[DIG_PER_DEC1-1]={
140 return (x + (x > 0 ? DIG_PER_DEC1 - 1 : 0)) / DIG_PER_DEC1; in ROUND_UP()
237 int firstdigits= intpart % DIG_PER_DEC1; in max_decimal()
240 for(intpart/= DIG_PER_DEC1; intpart; intpart--) in max_decimal()
246 int lastdigits= frac % DIG_PER_DEC1; in max_decimal()
247 for(frac/= DIG_PER_DEC1; frac; frac--) in max_decimal()
259 i= ((intg - 1) % DIG_PER_DEC1) + 1; in remove_leading_zeroes()
263 i= DIG_PER_DEC1; in remove_leading_zeroes()
268 for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ; in remove_leading_zeroes()
294 i= ((frac - 1) % DIG_PER_DEC1 + 1); in decimal_actual_fraction()
298 i= DIG_PER_DEC1; in decimal_actual_fraction()
303 for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1); in decimal_actual_fraction()
401 for (; frac>0; frac-=DIG_PER_DEC1) in decimal2string()
404 for (i=MY_MIN(frac, DIG_PER_DEC1); i; i--) in decimal2string()
424 for (buf=buf0+ROUND_UP(intg); intg>0; intg-=DIG_PER_DEC1) in decimal2string()
427 for (i=MY_MIN(intg, DIG_PER_DEC1); i; i--) in decimal2string()
474 start= DIG_PER_DEC1 - (i= ((from->intg-1) % DIG_PER_DEC1 + 1)); in digits_bounds()
479 i= DIG_PER_DEC1 - 1; in digits_bounds()
480 start= (int) ((buf_beg - from->buf) * DIG_PER_DEC1); in digits_bounds()
492 stop= (int) (((buf_end - from->buf) * DIG_PER_DEC1 + in digits_bounds()
493 (i= ((from->frac - 1) % DIG_PER_DEC1 + 1)))); in digits_bounds()
494 i= DIG_PER_DEC1 - i + 1; in digits_bounds()
498 stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1); in digits_bounds()
524 int c_shift= DIG_PER_DEC1 - shift; in do_mini_left_shift()
527 if (beg % DIG_PER_DEC1 < shift) in do_mini_left_shift()
554 int c_shift= DIG_PER_DEC1 - shift; in do_mini_right_shift()
557 if (DIG_PER_DEC1 - ((last - 1) % DIG_PER_DEC1 + 1) < shift) in do_mini_right_shift()
590 int point= ROUND_UP(dec->intg) * DIG_PER_DEC1; in decimal_shift()
629 diff= digits_frac - (new_frac_len * DIG_PER_DEC1); in decimal_shift()
633 digits_frac= new_frac_len * DIG_PER_DEC1; in decimal_shift()
646 if (shift % DIG_PER_DEC1) in decimal_shift()
656 l_mini_shift= shift % DIG_PER_DEC1; in decimal_shift()
657 r_mini_shift= DIG_PER_DEC1 - l_mini_shift; in decimal_shift()
664 DBUG_ASSERT(do_left || (dec->len * DIG_PER_DEC1 - end) >= r_mini_shift); in decimal_shift()
668 r_mini_shift= (-shift) % DIG_PER_DEC1; in decimal_shift()
669 l_mini_shift= DIG_PER_DEC1 - r_mini_shift; in decimal_shift()
671 do_left= !((dec->len * DIG_PER_DEC1 - end) >= r_mini_shift); in decimal_shift()
689 if (!(shift+= mini_shift) && (new_point - digits_int) < DIG_PER_DEC1) in decimal_shift()
700 if ((new_front= (new_point - digits_int)) >= DIG_PER_DEC1 || in decimal_shift()
709 d_shift= new_front / DIG_PER_DEC1; in decimal_shift()
723 d_shift= (1 - new_front) / DIG_PER_DEC1; in decimal_shift()
733 d_shift*= DIG_PER_DEC1; in decimal_shift()
820 if (intg > DIG_PER_DEC1 && s1[0] == '0' && s1[1] == '0') in internal_str2dec()
879 frac=frac1*DIG_PER_DEC1; in internal_str2dec()
881 intg=intg1*DIG_PER_DEC1; in internal_str2dec()
895 if (unlikely(++i == DIG_PER_DEC1)) in internal_str2dec()
910 if (unlikely(++i == DIG_PER_DEC1)) in internal_str2dec()
918 *buf=x*powers10[DIG_PER_DEC1-i]; in internal_str2dec()
1089 for(to->intg= (intg1-1)*DIG_PER_DEC1; from; to->intg++, from/=10) {} in ull2dec()
1129 for (intg=from->intg; intg > 0; intg-=DIG_PER_DEC1) in decimal2ulonglong()
1140 for (frac=from->frac; unlikely(frac > 0); frac-=DIG_PER_DEC1) in decimal2ulonglong()
1152 for (intg=from->intg; intg > 0; intg-=DIG_PER_DEC1) in decimal2longlong()
1180 for (frac=from->frac; unlikely(frac > 0); frac-=DIG_PER_DEC1) in decimal2longlong()
1270 intg0=intg/DIG_PER_DEC1, in decimal2bin()
1271 frac0=frac/DIG_PER_DEC1, in decimal2bin()
1272 intg0x=intg-intg0*DIG_PER_DEC1, in decimal2bin()
1273 frac0x=frac-frac0*DIG_PER_DEC1, in decimal2bin()
1274 frac1=from->frac/DIG_PER_DEC1, in decimal2bin()
1275 frac1x=from->frac-frac1*DIG_PER_DEC1, in decimal2bin()
1292 intg1=from_intg/DIG_PER_DEC1; in decimal2bin()
1293 intg1x=from_intg-intg1*DIG_PER_DEC1; in decimal2bin()
1355 lim=(frac1 < frac0 ? DIG_PER_DEC1 : frac0x); in decimal2bin()
1358 x=(*buf1 / powers10[DIG_PER_DEC1 - frac1x]) ^ mask; in decimal2bin()
1403 intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, in bin2decimal()
1404 intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1, in bin2decimal()
1434 to->intg=intg0*DIG_PER_DEC1+intg0x; in bin2decimal()
1435 to->frac=frac0*DIG_PER_DEC1+frac0x; in bin2decimal()
1467 to->intg-=DIG_PER_DEC1; in bin2decimal()
1490 *buf=(x ^ mask) * powers10[DIG_PER_DEC1 - frac0x]; in bin2decimal()
1535 intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, in decimal_bin_size()
1536 intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1; in decimal_bin_size()
1567 int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, in decimal_round()
1594 scale=frac0*DIG_PER_DEC1; in decimal_round()
1618 to->intg=MY_MIN(intg0, len)*DIG_PER_DEC1; in decimal_round()
1634 if (scale == frac0*DIG_PER_DEC1) in decimal_round()
1678 int pos=frac0*DIG_PER_DEC1-scale-1; in decimal_round()
1699 scale=frac0*DIG_PER_DEC1; in decimal_round()
1750 first_dig= to->intg % DIG_PER_DEC1; in decimal_round()
1826 max_decimal(to->len * DIG_PER_DEC1, 0, to); in do_add()
1834 to->intg=intg0*DIG_PER_DEC1; in do_add()
1837 set_if_smaller(to->frac, frac0*DIG_PER_DEC1); in do_add()
1967 to->intg=intg1*DIG_PER_DEC1; in do_sub()
1970 set_if_smaller(to->frac, frac0*DIG_PER_DEC1); in do_sub()
2097 to->intg=intg0*DIG_PER_DEC1; in decimal_mul()
2101 set_if_smaller(to->frac, frac0*DIG_PER_DEC1); in decimal_mul()
2102 set_if_smaller(to->intg, intg0*DIG_PER_DEC1); in decimal_mul()
2169 to->frac= DIG_PER_DEC1 * frac0; in decimal_mul()
2175 while (!*buf1 && (to->intg > DIG_PER_DEC1)) in decimal_mul()
2178 to->intg-= DIG_PER_DEC1; in decimal_mul()
2191 DBUG_ASSERT(to->intg <= DIG_PER_DEC1); in decimal_mul()
2211 int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1, in do_div_mod()
2212 frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2, in do_div_mod()
2224 i= ((prec2 - 1) % DIG_PER_DEC1) + 1; in do_div_mod()
2228 i= DIG_PER_DEC1; in do_div_mod()
2233 for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ; in do_div_mod()
2236 i=((prec1-1) % DIG_PER_DEC1)+1; in do_div_mod()
2240 i=DIG_PER_DEC1; in do_div_mod()
2248 for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ; in do_div_mod()
2258 dintg/=DIG_PER_DEC1; in do_div_mod()
2289 to->intg=intg0*DIG_PER_DEC1; in do_div_mod()
2290 to->frac=frac0*DIG_PER_DEC1; in do_div_mod()
2442 to->intg=MY_MIN(intg0*DIG_PER_DEC1, from2->intg); in do_div_mod()
2448 to->frac=frac0*DIG_PER_DEC1; in do_div_mod()