|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | 3 | // found in the LICENSE file. |
4 | 4 |
|
5 | | -#include "src/numbers/bignum-dtoa.h" |
| 5 | +#include "src/base/numbers/bignum-dtoa.h" |
6 | 6 |
|
7 | 7 | #include <cmath> |
8 | 8 |
|
9 | 9 | #include "src/base/logging.h" |
10 | | -#include "src/numbers/bignum.h" |
11 | | -#include "src/numbers/double.h" |
12 | | -#include "src/utils/utils.h" |
| 10 | +#include "src/base/numbers/bignum.h" |
| 11 | +#include "src/base/numbers/double.h" |
13 | 12 |
|
14 | 13 | namespace v8 { |
15 | | -namespace internal { |
| 14 | +namespace base { |
16 | 15 |
|
17 | 16 | static int NormalizedExponent(uint64_t significand, int exponent) { |
18 | 17 | DCHECK_NE(significand, 0); |
@@ -45,22 +44,22 @@ static void FixupMultiply10(int estimated_power, bool is_even, |
45 | 44 | // digits yield the shortest decimal representation of v. |
46 | 45 | static void GenerateShortestDigits(Bignum* numerator, Bignum* denominator, |
47 | 46 | Bignum* delta_minus, Bignum* delta_plus, |
48 | | - bool is_even, base::Vector<char> buffer, |
| 47 | + bool is_even, Vector<char> buffer, |
49 | 48 | int* length); |
50 | 49 | // Generates 'requested_digits' after the decimal point. |
51 | 50 | static void BignumToFixed(int requested_digits, int* decimal_point, |
52 | 51 | Bignum* numerator, Bignum* denominator, |
53 | | - base::Vector<char>(buffer), int* length); |
| 52 | + Vector<char>(buffer), int* length); |
54 | 53 | // Generates 'count' digits of numerator/denominator. |
55 | 54 | // Once 'count' digits have been produced rounds the result depending on the |
56 | 55 | // remainder (remainders of exactly .5 round upwards). Might update the |
57 | 56 | // decimal_point when rounding up (for example for 0.9999). |
58 | 57 | static void GenerateCountedDigits(int count, int* decimal_point, |
59 | 58 | Bignum* numerator, Bignum* denominator, |
60 | | - base::Vector<char>(buffer), int* length); |
| 59 | + Vector<char>(buffer), int* length); |
61 | 60 |
|
62 | 61 | void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, |
63 | | - base::Vector<char> buffer, int* length, int* decimal_point) { |
| 62 | + Vector<char> buffer, int* length, int* decimal_point) { |
64 | 63 | DCHECK_GT(v, 0); |
65 | 64 | DCHECK(!Double(v).IsSpecial()); |
66 | 65 | uint64_t significand = Double(v).Significand(); |
@@ -135,7 +134,7 @@ void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, |
135 | 134 | // will be produced. This should be the standard precondition. |
136 | 135 | static void GenerateShortestDigits(Bignum* numerator, Bignum* denominator, |
137 | 136 | Bignum* delta_minus, Bignum* delta_plus, |
138 | | - bool is_even, base::Vector<char> buffer, |
| 137 | + bool is_even, Vector<char> buffer, |
139 | 138 | int* length) { |
140 | 139 | // Small optimization: if delta_minus and delta_plus are the same just reuse |
141 | 140 | // one of the two bignums. |
@@ -232,7 +231,7 @@ static void GenerateShortestDigits(Bignum* numerator, Bignum* denominator, |
232 | 231 | // exponent (decimal_point), when rounding upwards. |
233 | 232 | static void GenerateCountedDigits(int count, int* decimal_point, |
234 | 233 | Bignum* numerator, Bignum* denominator, |
235 | | - base::Vector<char>(buffer), int* length) { |
| 234 | + Vector<char>(buffer), int* length) { |
236 | 235 | DCHECK_GE(count, 0); |
237 | 236 | for (int i = 0; i < count - 1; ++i) { |
238 | 237 | uint16_t digit; |
@@ -273,7 +272,7 @@ static void GenerateCountedDigits(int count, int* decimal_point, |
273 | 272 | // Input verifies: 1 <= (numerator + delta) / denominator < 10. |
274 | 273 | static void BignumToFixed(int requested_digits, int* decimal_point, |
275 | 274 | Bignum* numerator, Bignum* denominator, |
276 | | - base::Vector<char>(buffer), int* length) { |
| 275 | + Vector<char>(buffer), int* length) { |
277 | 276 | // Note that we have to look at more than just the requested_digits, since |
278 | 277 | // a number could be rounded up. Example: v=0.5 with requested_digits=0. |
279 | 278 | // Even though the power of v equals 0 we can't just stop here. |
@@ -604,5 +603,5 @@ static void FixupMultiply10(int estimated_power, bool is_even, |
604 | 603 | } |
605 | 604 | } |
606 | 605 |
|
607 | | -} // namespace internal |
| 606 | +} // namespace base |
608 | 607 | } // namespace v8 |
0 commit comments