| Index: Source/wtf/dtoa/bignum.h
|
| diff --git a/Source/wtf/dtoa/bignum.h b/Source/wtf/dtoa/bignum.h
|
| index 1a750581aa797229e788799a2b0b25b9fd248db3..b290cb16a742ffe2108a3e00ff674c0866728efc 100644
|
| --- a/Source/wtf/dtoa/bignum.h
|
| +++ b/Source/wtf/dtoa/bignum.h
|
| @@ -33,30 +33,30 @@
|
| namespace WTF {
|
|
|
| namespace double_conversion {
|
| -
|
| +
|
| class Bignum {
|
| public:
|
| // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately.
|
| // This bignum can encode much bigger numbers, since it contains an
|
| // exponent.
|
| static const int kMaxSignificantBits = 3584;
|
| -
|
| +
|
| Bignum();
|
| void AssignUInt16(uint16_t value);
|
| void AssignUInt64(uint64_t value);
|
| void AssignBignum(const Bignum& other);
|
| -
|
| +
|
| void AssignDecimalString(Vector<const char> value);
|
| void AssignHexString(Vector<const char> value);
|
| -
|
| +
|
| void AssignPowerUInt16(uint16_t base, int exponent);
|
| -
|
| +
|
| void AddUInt16(uint16_t operand);
|
| void AddUInt64(uint64_t operand);
|
| void AddBignum(const Bignum& other);
|
| // Precondition: this >= other.
|
| void SubtractBignum(const Bignum& other);
|
| -
|
| +
|
| void Square();
|
| void ShiftLeft(int shift_amount);
|
| void MultiplyByUInt32(uint32_t factor);
|
| @@ -68,9 +68,9 @@ namespace double_conversion {
|
| // this = this % other;
|
| // In the worst case this function is in O(this/other).
|
| uint16_t DivideModuloIntBignum(const Bignum& other);
|
| -
|
| +
|
| bool ToHexString(char* buffer, int buffer_size) const;
|
| -
|
| +
|
| static int Compare(const Bignum& a, const Bignum& b);
|
| static bool Equal(const Bignum& a, const Bignum& b) {
|
| return Compare(a, b) == 0;
|
| @@ -98,7 +98,7 @@ namespace double_conversion {
|
| private:
|
| typedef uint32_t Chunk;
|
| typedef uint64_t DoubleChunk;
|
| -
|
| +
|
| static const int kChunkSize = sizeof(Chunk) * 8;
|
| static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8;
|
| // With bigit size of 28 we loose some bits, but a double still fits easily
|
| @@ -108,7 +108,7 @@ namespace double_conversion {
|
| // Every instance allocates kBigitLength chunks on the stack. Bignums cannot
|
| // grow. There are no checks if the stack-allocated space is sufficient.
|
| static const int kBigitCapacity = kMaxSignificantBits / kBigitSize;
|
| -
|
| +
|
| void EnsureCapacity(int size) {
|
| if (size > kBigitCapacity) {
|
| UNREACHABLE();
|
| @@ -126,7 +126,7 @@ namespace double_conversion {
|
| int BigitLength() const { return used_digits_ + exponent_; }
|
| Chunk BigitAt(int index) const;
|
| void SubtractTimes(const Bignum& other, int factor);
|
| -
|
| +
|
| Chunk bigits_buffer_[kBigitCapacity];
|
| // A vector backed by bigits_buffer_. This way accesses to the array are
|
| // checked for out-of-bounds errors.
|
| @@ -134,10 +134,10 @@ namespace double_conversion {
|
| int used_digits_;
|
| // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize).
|
| int exponent_;
|
| -
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Bignum);
|
| };
|
| -
|
| +
|
| } // namespace double_conversion
|
|
|
| } // namespace WTF
|
|
|