Lines Matching defs:exponent

93 // formula: floor((mantissa * 2^exponent)/10^i) % 10^9.
95 // we use a shortcut. We can avoid calculating 2^exponent / 10^i by using a
99 // i > exponent since then 2^exponent / 10^i would be less than 1. To correct
100 // for this, the actual calculation done is 2^(exponent + c) / 10^i, and then
102 // floor((mantissa * table[exponent][i])/(2^c)) % 10^9.
128 "Incorrect exponent to perform log10_pow2 approximation.");
135 // conversion to get an explicit mantissa of 0x13441350fbd738 and an exponent
138 // the multiplication result, adding 12 to the exponent to compensate. To
169 // index (which is ceil(exponent/16)) and mantissa width could need.
184 LIBC_INLINE constexpr UInt<MID_INT_SIZE> get_table_positive(int exponent,
187 // this function. It should be large enough to hold 2^(exponent+constant), so
190 // bits in the number being exponentiated and m is the exponent.
192 static_cast<int>(exponent + CALC_SHIFT_CONST - (BLOCK_SIZE * i));
222 LIBC_INLINE UInt<MID_INT_SIZE> get_table_positive_df(int exponent, size_t i) {
232 static_cast<int>(exponent + CALC_SHIFT_CONST - (9 * i));
274 // as negative. We do the same with exponent, while they're both always negative
280 LIBC_INLINE UInt<MID_INT_SIZE> get_table_negative(int exponent, size_t i) {
281 int shift_amount = CALC_SHIFT_CONST - exponent;
332 LIBC_INLINE UInt<MID_INT_SIZE> get_table_negative_df(int exponent, size_t i) {
342 int shift_amount = CALC_SHIFT_CONST - exponent;
408 int exponent;
416 exponent = float_bits.get_explicit_exponent();
420 exponent -= FRACTION_LEN;
432 if (exponent >= -FRACTION_LEN) {
433 // idx is ceil(exponent/16) or 0 if exponent is negative. This is used to
437 exponent < 0
439 : static_cast<uint32_t>(exponent + (IDX_SIZE - 1)) / IDX_SIZE;
441 // shift_amount = -(c0 - exponent) = c_0 + 16 * ceil(exponent/16) -
442 // exponent
482 const uint32_t shift_amount = SHIFT_CONST + pos_exp - exponent;
493 if (exponent < 0) {
494 const int32_t idx = -exponent / IDX_SIZE;
544 SHIFT_CONST + (-exponent - static_cast<int32_t>(pos_exp));
562 if (exponent < -FRACTION_LEN)
565 exponent < 0
567 : static_cast<uint32_t>(exponent + (IDX_SIZE - 1)) / IDX_SIZE;
580 return num_requested_digits > -exponent;
582 const int32_t idx = -exponent / IDX_SIZE;
592 if (exponent < -FRACTION_LEN) {
593 const int pos_exp = -exponent - 1;
604 return MIN_BLOCK_2[-exponent / IDX_SIZE];
614 // doubles. They have the same max exponent, but even if they didn't the
621 int exponent = 0;
641 // store any number with a negative exponent.
668 // the mantissa and exponent of the initial number. Calling it will always
672 if (mantissa == 0 && exponent == 0)
675 if (exponent > 0) {
676 // if the exponent is positive, then the number is fully above the decimal
685 float_as_int <<= exponent;
697 // if the exponent is not positive, then the number is at least partially
702 const int SHIFT_AMOUNT = FLOAT_AS_INT_WIDTH + exponent;
731 exponent = float_bits.get_explicit_exponent();
735 exponent -= FRACTION_LEN;
741 if (exponent < -FRACTION_LEN)
745 exponent < 0
747 : static_cast<uint32_t>(exponent + (IDX_SIZE - 1)) / IDX_SIZE;
753 return MIN_BLOCK_2[-exponent / IDX_SIZE];
755 if (exponent >= -FRACTION_LEN)
758 const int pos_exp = -exponent - 1;
775 return num_requested_digits > -exponent;
779 if (exponent < -FRACTION_LEN)
790 if (exponent >= 0)