Lines Matching refs:exponent
119 int exponent,
132 exponent + (buffer.length() - kMaxSignificantDecimalDigits);
140 static void TrimAndCut(Vector<const char> buffer, int exponent,
145 exponent += left_trimmed.length() - right_trimmed.length();
149 CutToMaxSignificantDigits(right_trimmed, exponent,
155 *updated_exponent = exponent;
196 // Compute the binary exponent.
197 int exponent = 0;
198 *result = DiyFp(significand, exponent);
205 int exponent,
210 (void) exponent;
221 // If the 10^exponent (resp. 10^-exponent) fits into a double too then we
226 if (exponent < 0 && -exponent < kExactPowersOfTenSize) {
227 // 10^-exponent fits into a double.
230 *result /= exact_powers_of_ten[-exponent];
233 if (0 <= exponent && exponent < kExactPowersOfTenSize) {
234 // 10^exponent fits into a double.
237 *result *= exact_powers_of_ten[exponent];
242 if ((0 <= exponent) &&
243 (exponent - remaining_digits < kExactPowersOfTenSize)) {
245 // 10^remaining_digits. As a result the remaining exponent now fits
250 *result *= exact_powers_of_ten[exponent - remaining_digits];
259 // Returns 10^exponent as an exact DiyFp.
260 // The given exponent must be in the range [1; kDecimalExponentDistance[.
261 static DiyFp AdjustmentPowerOfTen(int exponent) {
262 DOUBLE_CONVERSION_ASSERT(0 < exponent);
263 DOUBLE_CONVERSION_ASSERT(exponent < PowersOfTenCache::kDecimalExponentDistance);
264 // Simply hardcode the remaining powers for the given decimal exponent
267 switch (exponent) {
285 int exponent,
297 // Move the remaining decimals into the exponent.
298 exponent += remaining_decimals;
305 DOUBLE_CONVERSION_ASSERT(exponent <= PowersOfTenCache::kMaxDecimalExponent);
306 if (exponent < PowersOfTenCache::kMinDecimalExponent) {
312 PowersOfTenCache::GetCachedPowerForDecimalExponent(exponent,
316 if (cached_decimal_exponent != exponent) {
317 int adjustment_exponent = exponent - cached_decimal_exponent;
395 // - -1 if buffer*10^exponent < diy_fp.
396 // - 0 if buffer*10^exponent == diy_fp.
397 // - +1 if buffer*10^exponent > diy_fp.
399 // buffer.length() + exponent <= kMaxDecimalPower + 1
400 // buffer.length() + exponent > kMinDecimalPower
403 int exponent,
405 DOUBLE_CONVERSION_ASSERT(buffer.length() + exponent <= kMaxDecimalPower + 1);
406 DOUBLE_CONVERSION_ASSERT(buffer.length() + exponent > kMinDecimalPower);
417 if (exponent >= 0) {
418 buffer_bignum.MultiplyByPowerOfTen(exponent);
420 diy_fp_bignum.MultiplyByPowerOfTen(-exponent);
433 static bool ComputeGuess(Vector<const char> trimmed, int exponent,
439 if (exponent + trimmed.length() - 1 >= kMaxDecimalPower) {
443 if (exponent + trimmed.length() <= kMinDecimalPower) {
448 if (DoubleStrtod(trimmed, exponent, guess) ||
449 DiyFpStrtod(trimmed, exponent, guess)) {
482 double StrtodTrimmed(Vector<const char> trimmed, int exponent) {
486 const bool is_correct = ComputeGuess(trimmed, exponent, &guess);
491 int comparison = CompareBufferWithDiyFp(trimmed, exponent, upper_boundary);
504 double Strtod(Vector<const char> buffer, int exponent) {
508 TrimAndCut(buffer, exponent, copy_buffer, kMaxSignificantDecimalDigits,
537 float Strtof(Vector<const char> buffer, int exponent) {
541 TrimAndCut(buffer, exponent, copy_buffer, kMaxSignificantDecimalDigits,
543 exponent = updated_exponent;
544 return StrtofTrimmed(trimmed, exponent);
547 float StrtofTrimmed(Vector<const char> trimmed, int exponent) {
552 bool is_correct = ComputeGuess(trimmed, exponent, &double_guess);
611 int comparison = CompareBufferWithDiyFp(trimmed, exponent, upper_boundary);