1 line
94 KiB
JavaScript
1 line
94 KiB
JavaScript
["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/math/integer.js"],"~:js","goog.provide(\"goog.math.Integer\");\ngoog.require(\"goog.reflect\");\ngoog.math.Integer = function(bits, sign) {\n this.sign_ = sign;\n var localBits = [];\n var top = true;\n for (var i = bits.length - 1; i >= 0; i--) {\n var val = bits[i] | 0;\n if (!top || val != sign) {\n localBits[i] = val;\n top = false;\n }\n }\n this.bits_ = localBits;\n};\ngoog.math.Integer.IntCache_ = {};\ngoog.math.Integer.fromInt = function(value) {\n if (-128 <= value && value < 128) {\n return goog.reflect.cache(goog.math.Integer.IntCache_, value, function(val) {\n return new goog.math.Integer([val | 0], val < 0 ? -1 : 0);\n });\n }\n return new goog.math.Integer([value | 0], value < 0 ? -1 : 0);\n};\ngoog.math.Integer.fromNumber = function(value) {\n if (isNaN(value) || !isFinite(value)) {\n return goog.math.Integer.ZERO;\n } else if (value < 0) {\n return goog.math.Integer.fromNumber(-value).negate();\n } else {\n var bits = [];\n var pow = 1;\n for (var i = 0; value >= pow; i++) {\n bits[i] = value / pow | 0;\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n }\n return new goog.math.Integer(bits, 0);\n }\n};\ngoog.math.Integer.fromBits = function(bits) {\n var high = bits[bits.length - 1];\n return new goog.math.Integer(bits, high & 1 << 31 ? -1 : 0);\n};\ngoog.math.Integer.fromString = function(str, opt_radix) {\n if (str.length == 0) {\n throw new Error(\"number format error: empty string\");\n }\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error(\"radix out of range: \" + radix);\n }\n if (str.charAt(0) == \"-\") {\n return goog.math.Integer.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf(\"-\") >= 0) {\n throw new Error('number format error: interior \"-\" character');\n }\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 8));\n var result = goog.math.Integer.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = goog.math.Integer.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(goog.math.Integer.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(goog.math.Integer.fromNumber(value));\n }\n }\n return result;\n};\ngoog.math.Integer.TWO_PWR_32_DBL_ = (1 << 16) * (1 << 16);\ngoog.math.Integer.ZERO = goog.math.Integer.fromInt(0);\ngoog.math.Integer.ONE = goog.math.Integer.fromInt(1);\ngoog.math.Integer.TWO_PWR_24_ = goog.math.Integer.fromInt(1 << 24);\ngoog.math.Integer.prototype.toInt = function() {\n return this.bits_.length > 0 ? this.bits_[0] : this.sign_;\n};\ngoog.math.Integer.prototype.toNumber = function() {\n if (this.isNegative()) {\n return -this.negate().toNumber();\n } else {\n var val = 0;\n var pow = 1;\n for (var i = 0; i < this.bits_.length; i++) {\n val += this.getBitsUnsigned(i) * pow;\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n }\n return val;\n }\n};\ngoog.math.Integer.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error(\"radix out of range: \" + radix);\n }\n if (this.isZero()) {\n return \"0\";\n } else if (this.isNegative()) {\n return \"-\" + this.negate().toString(radix);\n }\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 6));\n var rem = this;\n var result = \"\";\n while (true) {\n var remDiv = rem.divide(radixToPower);\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0;\n var digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 6) {\n digits = \"0\" + digits;\n }\n result = \"\" + digits + result;\n }\n }\n};\ngoog.math.Integer.prototype.getBits = function(index) {\n if (index < 0) {\n return 0;\n } else if (index < this.bits_.length) {\n return this.bits_[index];\n } else {\n return this.sign_;\n }\n};\ngoog.math.Integer.prototype.getBitsUnsigned = function(index) {\n var val = this.getBits(index);\n return val >= 0 ? val : goog.math.Integer.TWO_PWR_32_DBL_ + val;\n};\ngoog.math.Integer.prototype.getSign = function() {\n return this.sign_;\n};\ngoog.math.Integer.prototype.isZero = function() {\n if (this.sign_ != 0) {\n return false;\n }\n for (var i = 0; i < this.bits_.length; i++) {\n if (this.bits_[i] != 0) {\n return false;\n }\n }\n return true;\n};\ngoog.math.Integer.prototype.isNegative = function() {\n return this.sign_ == -1;\n};\ngoog.math.Integer.prototype.isOdd = function() {\n return this.bits_.length == 0 && this.sign_ == -1 || this.bits_.length > 0 && (this.bits_[0] & 1) != 0;\n};\ngoog.math.Integer.prototype.equals = function(other) {\n if (this.sign_ != other.sign_) {\n return false;\n }\n var len = Math.max(this.bits_.length, other.bits_.length);\n for (var i = 0; i < len; i++) {\n if (this.getBits(i) != other.getBits(i)) {\n return false;\n }\n }\n return true;\n};\ngoog.math.Integer.prototype.notEquals = function(other) {\n return !this.equals(other);\n};\ngoog.math.Integer.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n};\ngoog.math.Integer.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n};\ngoog.math.Integer.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n};\ngoog.math.Integer.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n};\ngoog.math.Integer.prototype.compare = function(other) {\n var diff = this.subtract(other);\n if (diff.isNegative()) {\n return -1;\n } else if (diff.isZero()) {\n return 0;\n } else {\n return +1;\n }\n};\ngoog.math.Integer.prototype.shorten = function(numBits) {\n var arr_index = numBits - 1 >> 5;\n var bit_index = (numBits - 1) % 32;\n var bits = [];\n for (var i = 0; i < arr_index; i++) {\n bits[i] = this.getBits(i);\n }\n var sigBits = bit_index == 31 ? 4294967295 : (1 << bit_index + 1) - 1;\n var val = this.getBits(arr_index) & sigBits;\n if (val & 1 << bit_index) {\n val |= 4294967295 - sigBits;\n bits[arr_index] = val;\n return new goog.math.Integer(bits, -1);\n } else {\n bits[arr_index] = val;\n return new goog.math.Integer(bits, 0);\n }\n};\ngoog.math.Integer.prototype.negate = function() {\n return this.not().add(goog.math.Integer.ONE);\n};\ngoog.math.Integer.prototype.abs = function() {\n return this.isNegative() ? this.negate() : this;\n};\ngoog.math.Integer.prototype.add = function(other) {\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n var carry = 0;\n for (var i = 0; i <= len; i++) {\n var a1 = this.getBits(i) >>> 16;\n var a0 = this.getBits(i) & 65535;\n var b1 = other.getBits(i) >>> 16;\n var b0 = other.getBits(i) & 65535;\n var c0 = carry + a0 + b0;\n var c1 = (c0 >>> 16) + a1 + b1;\n carry = c1 >>> 16;\n c0 &= 65535;\n c1 &= 65535;\n arr[i] = c1 << 16 | c0;\n }\n return goog.math.Integer.fromBits(arr);\n};\ngoog.math.Integer.prototype.subtract = function(other) {\n return this.add(other.negate());\n};\ngoog.math.Integer.prototype.multiply = function(other) {\n if (this.isZero()) {\n return goog.math.Integer.ZERO;\n } else if (other.isZero()) {\n return goog.math.Integer.ZERO;\n }\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n if (this.lessThan(goog.math.Integer.TWO_PWR_24_) && other.lessThan(goog.math.Integer.TWO_PWR_24_)) {\n return goog.math.Integer.fromNumber(this.toNumber() * other.toNumber());\n }\n var len = this.bits_.length + other.bits_.length;\n var arr = [];\n for (var i = 0; i < 2 * len; i++) {\n arr[i] = 0;\n }\n for (var i = 0; i < this.bits_.length; i++) {\n for (var j = 0; j < other.bits_.length; j++) {\n var a1 = this.getBits(i) >>> 16;\n var a0 = this.getBits(i) & 65535;\n var b1 = other.getBits(j) >>> 16;\n var b0 = other.getBits(j) & 65535;\n arr[2 * i + 2 * j] += a0 * b0;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j);\n arr[2 * i + 2 * j + 1] += a1 * b0;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n arr[2 * i + 2 * j + 1] += a0 * b1;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n arr[2 * i + 2 * j + 2] += a1 * b1;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 2);\n }\n }\n for (var i = 0; i < len; i++) {\n arr[i] = arr[2 * i + 1] << 16 | arr[2 * i];\n }\n for (var i = len; i < 2 * len; i++) {\n arr[i] = 0;\n }\n return new goog.math.Integer(arr, 0);\n};\ngoog.math.Integer.carry16_ = function(bits, index) {\n while ((bits[index] & 65535) != bits[index]) {\n bits[index + 1] += bits[index] >>> 16;\n bits[index] &= 65535;\n index++;\n }\n};\ngoog.math.Integer.prototype.slowDivide_ = function(other) {\n if (this.isNegative() || other.isNegative()) {\n throw new Error(\"slowDivide_ only works with positive integers.\");\n }\n var twoPower = goog.math.Integer.ONE;\n var multiple = other;\n while (multiple.lessThanOrEqual(this)) {\n twoPower = twoPower.shiftLeft(1);\n multiple = multiple.shiftLeft(1);\n }\n var res = twoPower.shiftRight(1);\n var total = multiple.shiftRight(1);\n var total2;\n multiple = multiple.shiftRight(2);\n twoPower = twoPower.shiftRight(2);\n while (!multiple.isZero()) {\n total2 = total.add(multiple);\n if (total2.lessThanOrEqual(this)) {\n res = res.add(twoPower);\n total = total2;\n }\n multiple = multiple.shiftRight(1);\n twoPower = twoPower.shiftRight(1);\n }\n var remainder = this.subtract(res.multiply(other));\n return new goog.math.Integer.DivisionResult(res, remainder);\n};\ngoog.math.Integer.prototype.divide = function(other) {\n return this.divideAndRemainder(other).quotient;\n};\ngoog.math.Integer.DivisionResult = function(quotient, remainder) {\n this.quotient = quotient;\n this.remainder = remainder;\n};\ngoog.math.Integer.prototype.divideAndRemainder = function(other) {\n if (other.isZero()) {\n throw new Error(\"division by zero\");\n } else if (this.isZero()) {\n return new goog.math.Integer.DivisionResult(goog.math.Integer.ZERO, goog.math.Integer.ZERO);\n }\n if (this.isNegative()) {\n var result = this.negate().divideAndRemainder(other);\n return new goog.math.Integer.DivisionResult(result.quotient.negate(), result.remainder.negate());\n } else if (other.isNegative()) {\n var result = this.divideAndRemainder(other.negate());\n return new goog.math.Integer.DivisionResult(result.quotient.negate(), result.remainder);\n }\n if (this.bits_.length > 30) {\n return this.slowDivide_(other);\n }\n var res = goog.math.Integer.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);\n var approxRes = goog.math.Integer.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = goog.math.Integer.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n if (approxRes.isZero()) {\n approxRes = goog.math.Integer.ONE;\n }\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return new goog.math.Integer.DivisionResult(res, rem);\n};\ngoog.math.Integer.prototype.modulo = function(other) {\n return this.divideAndRemainder(other).remainder;\n};\ngoog.math.Integer.prototype.not = function() {\n var len = this.bits_.length;\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = ~this.bits_[i];\n }\n return new goog.math.Integer(arr, ~this.sign_);\n};\ngoog.math.Integer.prototype.and = function(other) {\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) & other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ & other.sign_);\n};\ngoog.math.Integer.prototype.or = function(other) {\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) | other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ | other.sign_);\n};\ngoog.math.Integer.prototype.xor = function(other) {\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) ^ other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ ^ other.sign_);\n};\ngoog.math.Integer.prototype.shiftLeft = function(numBits) {\n var arr_delta = numBits >> 5;\n var bit_delta = numBits % 32;\n var len = this.bits_.length + arr_delta + (bit_delta > 0 ? 1 : 0);\n var arr = [];\n for (var i = 0; i < len; i++) {\n if (bit_delta > 0) {\n arr[i] = this.getBits(i - arr_delta) << bit_delta | this.getBits(i - arr_delta - 1) >>> 32 - bit_delta;\n } else {\n arr[i] = this.getBits(i - arr_delta);\n }\n }\n return new goog.math.Integer(arr, this.sign_);\n};\ngoog.math.Integer.prototype.shiftRight = function(numBits) {\n var arr_delta = numBits >> 5;\n var bit_delta = numBits % 32;\n var len = this.bits_.length - arr_delta;\n var arr = [];\n for (var i = 0; i < len; i++) {\n if (bit_delta > 0) {\n arr[i] = this.getBits(i + arr_delta) >>> bit_delta | this.getBits(i + arr_delta + 1) << 32 - bit_delta;\n } else {\n arr[i] = this.getBits(i + arr_delta);\n }\n }\n return new goog.math.Integer(arr, this.sign_);\n};\n","~:source","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Defines an Integer class for representing (potentially)\n * infinite length two's-complement integer values.\n *\n * For the specific case of 64-bit integers, use goog.math.Long, which is more\n * efficient.\n */\n\ngoog.provide('goog.math.Integer');\n\ngoog.require('goog.reflect');\n\n/**\n * Constructs a two's-complement integer an array containing bits of the\n * integer in 32-bit (signed) pieces, given in little-endian order (i.e.,\n * lowest-order bits in the first piece), and the sign of -1 or 0.\n *\n * See the from* functions below for other convenient ways of constructing\n * Integers.\n *\n * The internal representation of an integer is an array of 32-bit signed\n * pieces, along with a sign (0 or -1) that indicates the contents of all the\n * other 32-bit pieces out to infinity. We use 32-bit pieces because these are\n * the size of integers on which JavaScript performs bit-operations. For\n * operations like addition and multiplication, we split each number into 16-bit\n * pieces, which can easily be multiplied within JavaScript's floating-point\n * representation without overflow or change in sign.\n *\n * @struct\n * @constructor\n * @param {Array<number>} bits Array containing the bits of the number.\n * @param {number} sign The sign of the number: -1 for negative and 0 positive.\n * @final\n */\ngoog.math.Integer = function(bits, sign) {\n 'use strict';\n /**\n * @type {number}\n * @private\n */\n this.sign_ = sign;\n\n // Note: using a local variable while initializing the array helps the\n // compiler understand that assigning to the array is local side-effect and\n // that enables the entire constructor to be seen as side-effect free.\n var localBits = [];\n\n // Copy the 32-bit signed integer values passed in. We prune out those at the\n // top that equal the sign since they are redundant.\n var top = true;\n\n for (var i = bits.length - 1; i >= 0; i--) {\n var val = bits[i] | 0;\n if (!top || val != sign) {\n localBits[i] = val;\n top = false;\n }\n }\n\n /**\n * @type {!Array<number>}\n * @private\n * @const\n */\n this.bits_ = localBits;\n};\n\n\n// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n// from* methods on which they depend.\n\n\n/**\n * A cache of the Integer representations of small integer values.\n * @type {!Object<number, !goog.math.Integer>}\n * @private\n */\ngoog.math.Integer.IntCache_ = {};\n\n\n/**\n * Returns an Integer representing the given (32-bit) integer value.\n * @param {number} value A 32-bit integer value.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromInt = function(value) {\n 'use strict';\n if (-128 <= value && value < 128) {\n return goog.reflect.cache(\n goog.math.Integer.IntCache_, value, function(val) {\n 'use strict';\n return new goog.math.Integer([val | 0], val < 0 ? -1 : 0);\n });\n }\n return new goog.math.Integer([value | 0], value < 0 ? -1 : 0);\n};\n\n\n/**\n * Returns an Integer representing the given value, provided that it is a finite\n * number. Otherwise, zero is returned.\n * @param {number} value The value in question.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromNumber = function(value) {\n 'use strict';\n if (isNaN(value) || !isFinite(value)) {\n return goog.math.Integer.ZERO;\n } else if (value < 0) {\n return goog.math.Integer.fromNumber(-value).negate();\n } else {\n var bits = [];\n var pow = 1;\n for (var i = 0; value >= pow; i++) {\n bits[i] = (value / pow) | 0;\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n }\n return new goog.math.Integer(bits, 0);\n }\n};\n\n\n/**\n * Returns a Integer representing the value that comes by concatenating the\n * given entries, each is assumed to be 32 signed bits, given in little-endian\n * order (lowest order bits in the lowest index), and sign-extending the highest\n * order 32-bit value.\n * @param {Array<number>} bits The bits of the number, in 32-bit signed pieces,\n * in little-endian order.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromBits = function(bits) {\n 'use strict';\n var high = bits[bits.length - 1];\n return new goog.math.Integer(bits, high & (1 << 31) ? -1 : 0);\n};\n\n\n/**\n * Returns an Integer representation of the given string, written using the\n * given radix.\n * @param {string} str The textual representation of the Integer.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromString = function(str, opt_radix) {\n 'use strict';\n if (str.length == 0) {\n throw new Error('number format error: empty string');\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error('radix out of range: ' + radix);\n }\n\n if (str.charAt(0) == '-') {\n return goog.math.Integer.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf('-') >= 0) {\n throw new Error('number format error: interior \"-\" character');\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 8));\n\n var result = goog.math.Integer.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = goog.math.Integer.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(goog.math.Integer.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(goog.math.Integer.fromNumber(value));\n }\n }\n return result;\n};\n\n\n/**\n * A number used repeatedly in calculations. This must appear before the first\n * call to the from* functions below.\n * @type {number}\n * @private\n */\ngoog.math.Integer.TWO_PWR_32_DBL_ = (1 << 16) * (1 << 16);\n\n\n/** @type {!goog.math.Integer} */\ngoog.math.Integer.ZERO = goog.math.Integer.fromInt(0);\n\n/** @type {!goog.math.Integer} */\ngoog.math.Integer.ONE = goog.math.Integer.fromInt(1);\n\n\n/**\n * @const\n * @type {!goog.math.Integer}\n * @private\n */\ngoog.math.Integer.TWO_PWR_24_ = goog.math.Integer.fromInt(1 << 24);\n\n/**\n * Returns the value, assuming it is a 32-bit integer.\n * @return {number} The corresponding int value.\n */\ngoog.math.Integer.prototype.toInt = function() {\n 'use strict';\n return this.bits_.length > 0 ? this.bits_[0] : this.sign_;\n};\n\n\n/** @return {number} The closest floating-point representation to this value. */\ngoog.math.Integer.prototype.toNumber = function() {\n 'use strict';\n if (this.isNegative()) {\n return -this.negate().toNumber();\n } else {\n var val = 0;\n var pow = 1;\n for (var i = 0; i < this.bits_.length; i++) {\n val += this.getBitsUnsigned(i) * pow;\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n }\n return val;\n }\n};\n\n\n/**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n * @override\n */\ngoog.math.Integer.prototype.toString = function(opt_radix) {\n 'use strict';\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw new Error('radix out of range: ' + radix);\n }\n\n if (this.isZero()) {\n return '0';\n } else if (this.isNegative()) {\n return '-' + this.negate().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 6));\n\n var rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.divide(radixToPower);\n // The right shifting fixes negative values in the case when\n // intval >= 2^31; for more details see\n // https://github.com/google/closure-library/pull/498\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0;\n var digits = intval.toString(radix);\n\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 6) {\n digits = '0' + digits;\n }\n result = '' + digits + result;\n }\n }\n};\n\n\n/**\n * Returns the index-th 32-bit (signed) piece of the Integer according to\n * little-endian order (i.e., index 0 contains the smallest bits).\n * @param {number} index The index in question.\n * @return {number} The requested 32-bits as a signed number.\n */\ngoog.math.Integer.prototype.getBits = function(index) {\n 'use strict';\n if (index < 0) {\n return 0; // Allowing this simplifies bit shifting operations below...\n } else if (index < this.bits_.length) {\n return this.bits_[index];\n } else {\n return this.sign_;\n }\n};\n\n\n/**\n * Returns the index-th 32-bit piece as an unsigned number.\n * @param {number} index The index in question.\n * @return {number} The requested 32-bits as an unsigned number.\n */\ngoog.math.Integer.prototype.getBitsUnsigned = function(index) {\n 'use strict';\n var val = this.getBits(index);\n return val >= 0 ? val : goog.math.Integer.TWO_PWR_32_DBL_ + val;\n};\n\n\n/** @return {number} The sign bit of this number, -1 or 0. */\ngoog.math.Integer.prototype.getSign = function() {\n 'use strict';\n return this.sign_;\n};\n\n\n/** @return {boolean} Whether this value is zero. */\ngoog.math.Integer.prototype.isZero = function() {\n 'use strict';\n if (this.sign_ != 0) {\n return false;\n }\n for (var i = 0; i < this.bits_.length; i++) {\n if (this.bits_[i] != 0) {\n return false;\n }\n }\n return true;\n};\n\n\n/** @return {boolean} Whether this value is negative. */\ngoog.math.Integer.prototype.isNegative = function() {\n 'use strict';\n return this.sign_ == -1;\n};\n\n\n/** @return {boolean} Whether this value is odd. */\ngoog.math.Integer.prototype.isOdd = function() {\n 'use strict';\n return (this.bits_.length == 0) && (this.sign_ == -1) ||\n (this.bits_.length > 0) && ((this.bits_[0] & 1) != 0);\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer equals the other.\n */\ngoog.math.Integer.prototype.equals = function(other) {\n 'use strict';\n if (this.sign_ != other.sign_) {\n return false;\n }\n var len = Math.max(this.bits_.length, other.bits_.length);\n for (var i = 0; i < len; i++) {\n if (this.getBits(i) != other.getBits(i)) {\n return false;\n }\n }\n return true;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer does not equal the other.\n */\ngoog.math.Integer.prototype.notEquals = function(other) {\n 'use strict';\n return !this.equals(other);\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is greater than the other.\n */\ngoog.math.Integer.prototype.greaterThan = function(other) {\n 'use strict';\n return this.compare(other) > 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is greater than or equal to the other.\n */\ngoog.math.Integer.prototype.greaterThanOrEqual = function(other) {\n 'use strict';\n return this.compare(other) >= 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is less than the other.\n */\ngoog.math.Integer.prototype.lessThan = function(other) {\n 'use strict';\n return this.compare(other) < 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is less than or equal to the other.\n */\ngoog.math.Integer.prototype.lessThanOrEqual = function(other) {\n 'use strict';\n return this.compare(other) <= 0;\n};\n\n\n/**\n * Compares this Integer with the given one.\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\ngoog.math.Integer.prototype.compare = function(other) {\n 'use strict';\n var diff = this.subtract(other);\n if (diff.isNegative()) {\n return -1;\n } else if (diff.isZero()) {\n return 0;\n } else {\n return +1;\n }\n};\n\n\n/**\n * Returns an integer with only the first numBits bits of this value, sign\n * extended from the final bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} The shorted integer value.\n */\ngoog.math.Integer.prototype.shorten = function(numBits) {\n 'use strict';\n var arr_index = (numBits - 1) >> 5;\n var bit_index = (numBits - 1) % 32;\n var bits = [];\n for (var i = 0; i < arr_index; i++) {\n bits[i] = this.getBits(i);\n }\n var sigBits = bit_index == 31 ? 0xFFFFFFFF : (1 << (bit_index + 1)) - 1;\n var val = this.getBits(arr_index) & sigBits;\n if (val & (1 << bit_index)) {\n val |= 0xFFFFFFFF - sigBits;\n bits[arr_index] = val;\n return new goog.math.Integer(bits, -1);\n } else {\n bits[arr_index] = val;\n return new goog.math.Integer(bits, 0);\n }\n};\n\n\n/** @return {!goog.math.Integer} The negation of this value. */\ngoog.math.Integer.prototype.negate = function() {\n 'use strict';\n return this.not().add(goog.math.Integer.ONE);\n};\n\n\n/** @return {!goog.math.Integer} The absolute value of this value. */\ngoog.math.Integer.prototype.abs = function() {\n 'use strict';\n return this.isNegative() ? this.negate() : this;\n};\n\n\n/**\n * Returns the sum of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to add to this.\n * @return {!goog.math.Integer} The Integer result.\n */\ngoog.math.Integer.prototype.add = function(other) {\n 'use strict';\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n var carry = 0;\n\n for (var i = 0; i <= len; i++) {\n var a1 = this.getBits(i) >>> 16;\n var a0 = this.getBits(i) & 0xFFFF;\n\n var b1 = other.getBits(i) >>> 16;\n var b0 = other.getBits(i) & 0xFFFF;\n\n var c0 = carry + a0 + b0;\n var c1 = (c0 >>> 16) + a1 + b1;\n carry = c1 >>> 16;\n c0 &= 0xFFFF;\n c1 &= 0xFFFF;\n arr[i] = (c1 << 16) | c0;\n }\n return goog.math.Integer.fromBits(arr);\n};\n\n\n/**\n * Returns the difference of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to subtract from this.\n * @return {!goog.math.Integer} The Integer result.\n */\ngoog.math.Integer.prototype.subtract = function(other) {\n 'use strict';\n return this.add(other.negate());\n};\n\n\n/**\n * Returns the product of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to multiply against this.\n * @return {!goog.math.Integer} The product of this and the other.\n */\ngoog.math.Integer.prototype.multiply = function(other) {\n 'use strict';\n if (this.isZero()) {\n return goog.math.Integer.ZERO;\n } else if (other.isZero()) {\n return goog.math.Integer.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n\n // If both numbers are small, use float multiplication\n if (this.lessThan(goog.math.Integer.TWO_PWR_24_) &&\n other.lessThan(goog.math.Integer.TWO_PWR_24_)) {\n return goog.math.Integer.fromNumber(this.toNumber() * other.toNumber());\n }\n\n // Fill in an array of 16-bit products.\n var len = this.bits_.length + other.bits_.length;\n var arr = [];\n for (var i = 0; i < 2 * len; i++) {\n arr[i] = 0;\n }\n for (var i = 0; i < this.bits_.length; i++) {\n for (var j = 0; j < other.bits_.length; j++) {\n var a1 = this.getBits(i) >>> 16;\n var a0 = this.getBits(i) & 0xFFFF;\n\n var b1 = other.getBits(j) >>> 16;\n var b0 = other.getBits(j) & 0xFFFF;\n\n arr[2 * i + 2 * j] += a0 * b0;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j);\n arr[2 * i + 2 * j + 1] += a1 * b0;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n arr[2 * i + 2 * j + 1] += a0 * b1;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n arr[2 * i + 2 * j + 2] += a1 * b1;\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 2);\n }\n }\n\n // Combine the 16-bit values into 32-bit values.\n for (var i = 0; i < len; i++) {\n arr[i] = (arr[2 * i + 1] << 16) | arr[2 * i];\n }\n for (var i = len; i < 2 * len; i++) {\n arr[i] = 0;\n }\n return new goog.math.Integer(arr, 0);\n};\n\n\n/**\n * Carries any overflow from the given index into later entries.\n * @param {Array<number>} bits Array of 16-bit values in little-endian order.\n * @param {number} index The index in question.\n * @private\n */\ngoog.math.Integer.carry16_ = function(bits, index) {\n 'use strict';\n while ((bits[index] & 0xFFFF) != bits[index]) {\n bits[index + 1] += bits[index] >>> 16;\n bits[index] &= 0xFFFF;\n index++;\n }\n};\n\n\n/**\n * Returns \"this\" Integer divided by the given one. Both \"this\" and the given\n * Integer MUST be positive.\n *\n * This method is only needed for very large numbers (>10^308),\n * for which the original division algorithm gets into an infinite\n * loop (see https://github.com/google/closure-library/issues/500).\n *\n * The algorithm has some possible performance enhancements (or\n * could be rewritten entirely), it's just an initial solution for\n * the issue linked above.\n *\n * @param {!goog.math.Integer} other The Integer to divide \"this\" by.\n * @return {!goog.math.Integer.DivisionResult}\n * @private\n */\ngoog.math.Integer.prototype.slowDivide_ = function(other) {\n 'use strict';\n if (this.isNegative() || other.isNegative()) {\n throw new Error('slowDivide_ only works with positive integers.');\n }\n\n var twoPower = goog.math.Integer.ONE;\n var multiple = other;\n\n // First we have to figure out what the highest bit of the result\n // is, so we increase \"twoPower\" and \"multiple\" until \"multiple\"\n // exceeds \"this\".\n while (multiple.lessThanOrEqual(this)) {\n twoPower = twoPower.shiftLeft(1);\n multiple = multiple.shiftLeft(1);\n }\n\n // Rewind by one power of two, giving us the highest bit of the\n // result.\n var res = twoPower.shiftRight(1);\n var total = multiple.shiftRight(1);\n\n // Now we starting decreasing \"multiple\" and \"twoPower\" to find the\n // rest of the bits of the result.\n var total2;\n multiple = multiple.shiftRight(2);\n twoPower = twoPower.shiftRight(2);\n while (!multiple.isZero()) {\n // whenever we can add \"multiple\" to the total and not exceed\n // \"this\", that means we've found a 1 bit. Else we've found a 0\n // and don't need to add to the result.\n total2 = total.add(multiple);\n if (total2.lessThanOrEqual(this)) {\n res = res.add(twoPower);\n total = total2;\n }\n multiple = multiple.shiftRight(1);\n twoPower = twoPower.shiftRight(1);\n }\n\n\n // TODO(user): Calculate this more efficiently during the division.\n // This is kind of a waste since it isn't always needed, but it keeps the\n // API smooth. Since this is already a slow path it probably isn't a big deal.\n var remainder = this.subtract(res.multiply(other));\n return new goog.math.Integer.DivisionResult(res, remainder);\n};\n\n\n/**\n * Returns this Integer divided by the given one.\n * @param {!goog.math.Integer} other The Integer to divide this by.\n * @return {!goog.math.Integer} This value divided by the given one.\n */\ngoog.math.Integer.prototype.divide = function(other) {\n 'use strict';\n return this.divideAndRemainder(other).quotient;\n};\n\n\n/**\n * A struct for holding the quotient and remainder of a division.\n *\n * @constructor\n * @final\n * @struct\n *\n * @param {!goog.math.Integer} quotient\n * @param {!goog.math.Integer} remainder\n */\ngoog.math.Integer.DivisionResult = function(quotient, remainder) {\n 'use strict';\n /** @const */\n this.quotient = quotient;\n\n /** @const */\n this.remainder = remainder;\n};\n\n\n/**\n * Returns this Integer divided by the given one, as well as the remainder of\n * that division.\n *\n * @param {!goog.math.Integer} other The Integer to divide this by.\n * @return {!goog.math.Integer.DivisionResult}\n */\ngoog.math.Integer.prototype.divideAndRemainder = function(other) {\n 'use strict';\n if (other.isZero()) {\n throw new Error('division by zero');\n } else if (this.isZero()) {\n return new goog.math.Integer.DivisionResult(\n goog.math.Integer.ZERO, goog.math.Integer.ZERO);\n }\n\n if (this.isNegative()) {\n // Do the division on the negative of the numerator...\n var result = this.negate().divideAndRemainder(other);\n return new goog.math.Integer.DivisionResult(\n // ...and flip the sign back after.\n result.quotient.negate(),\n // The remainder must always have the same sign as the numerator.\n result.remainder.negate());\n } else if (other.isNegative()) {\n // Do the division on the negative of the denominator...\n var result = this.divideAndRemainder(other.negate());\n return new goog.math.Integer.DivisionResult(\n // ...and flip the sign back after.\n result.quotient.negate(),\n // The remainder must always have the same sign as the numerator.\n result.remainder);\n }\n\n // Have to degrade to slowDivide for Very Large Numbers, because\n // they're out of range for the floating-point approximation\n // technique used below.\n if (this.bits_.length > 30) {\n return this.slowDivide_(other);\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = goog.math.Integer.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = goog.math.Integer.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = goog.math.Integer.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = goog.math.Integer.ONE;\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return new goog.math.Integer.DivisionResult(res, rem);\n};\n\n\n/**\n * Returns this Integer modulo the given one.\n * @param {!goog.math.Integer} other The Integer by which to mod.\n * @return {!goog.math.Integer} This value modulo the given one.\n */\ngoog.math.Integer.prototype.modulo = function(other) {\n 'use strict';\n return this.divideAndRemainder(other).remainder;\n};\n\n\n/** @return {!goog.math.Integer} The bitwise-NOT of this value. */\ngoog.math.Integer.prototype.not = function() {\n 'use strict';\n var len = this.bits_.length;\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = ~this.bits_[i];\n }\n return new goog.math.Integer(arr, ~this.sign_);\n};\n\n\n/**\n * Returns the bitwise-AND of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to AND with this.\n * @return {!goog.math.Integer} The bitwise-AND of this and the other.\n */\ngoog.math.Integer.prototype.and = function(other) {\n 'use strict';\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) & other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ & other.sign_);\n};\n\n\n/**\n * Returns the bitwise-OR of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to OR with this.\n * @return {!goog.math.Integer} The bitwise-OR of this and the other.\n */\ngoog.math.Integer.prototype.or = function(other) {\n 'use strict';\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) | other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ | other.sign_);\n};\n\n\n/**\n * Returns the bitwise-XOR of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to XOR with this.\n * @return {!goog.math.Integer} The bitwise-XOR of this and the other.\n */\ngoog.math.Integer.prototype.xor = function(other) {\n 'use strict';\n var len = Math.max(this.bits_.length, other.bits_.length);\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr[i] = this.getBits(i) ^ other.getBits(i);\n }\n return new goog.math.Integer(arr, this.sign_ ^ other.sign_);\n};\n\n\n/**\n * Returns this value with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} This shifted to the left by the given amount.\n */\ngoog.math.Integer.prototype.shiftLeft = function(numBits) {\n 'use strict';\n var arr_delta = numBits >> 5;\n var bit_delta = numBits % 32;\n var len = this.bits_.length + arr_delta + (bit_delta > 0 ? 1 : 0);\n var arr = [];\n for (var i = 0; i < len; i++) {\n if (bit_delta > 0) {\n arr[i] = (this.getBits(i - arr_delta) << bit_delta) |\n (this.getBits(i - arr_delta - 1) >>> (32 - bit_delta));\n } else {\n arr[i] = this.getBits(i - arr_delta);\n }\n }\n return new goog.math.Integer(arr, this.sign_);\n};\n\n\n/**\n * Returns this value with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} This shifted to the right by the given amount.\n */\ngoog.math.Integer.prototype.shiftRight = function(numBits) {\n 'use strict';\n var arr_delta = numBits >> 5;\n var bit_delta = numBits % 32;\n var len = this.bits_.length - arr_delta;\n var arr = [];\n for (var i = 0; i < len; i++) {\n if (bit_delta > 0) {\n arr[i] = (this.getBits(i + arr_delta) >>> bit_delta) |\n (this.getBits(i + arr_delta + 1) << (32 - bit_delta));\n } else {\n arr[i] = this.getBits(i + arr_delta);\n }\n }\n return new goog.math.Integer(arr, this.sign_);\n};\n","~:compiled-at",1684858197843,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.math.integer.js\",\n\"lineCount\":423,\n\"mappings\":\"AAcAA,IAAKC,CAAAA,OAAL,CAAa,mBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,cAAb,CAAA;AAwBAF,IAAKG,CAAAA,IAAKC,CAAAA,OAAV,GAAoBC,QAAQ,CAACC,IAAD,EAAOC,IAAP,CAAa;AAMvC,MAAKC,CAAAA,KAAL,GAAaD,IAAb;AAKA,MAAIE,YAAY,EAAhB;AAIA,MAAIC,MAAM,IAAV;AAEA,OAAK,IAAIC,IAAIL,IAAKM,CAAAA,MAATD,GAAkB,CAA3B,EAA8BA,CAA9B,IAAmC,CAAnC,EAAsCA,CAAA,EAAtC,CAA2C;AACzC,QAAIE,MAAMP,IAAA,CAAKK,CAAL,CAANE,GAAgB,CAApB;AACA,QAAI,CAACH,GAAL,IAAYG,GAAZ,IAAmBN,IAAnB,CAAyB;AACvBE,eAAA,CAAUE,CAAV,CAAA,GAAeE,GAAf;AACAH,SAAA,GAAM,KAAN;AAFuB;AAFgB;AAa3C,MAAKI,CAAAA,KAAL,GAAaL,SAAb;AA9BuC,CAAzC;AA2CAT,IAAKG,CAAAA,IAAKC,CAAAA,OAAQW,CAAAA,SAAlB,GAA8B,EAA9B;AAQAf,IAAKG,CAAAA,IAAKC,CAAAA,OAAQY,CAAAA,OAAlB,GAA4BC,QAAQ,CAACC,KAAD,CAAQ;AAE1C,MAAI,CAAC,GAAL,IAAYA,KAAZ,IAAqBA,KAArB,GAA6B,GAA7B;AACE,WAAOlB,IAAKmB,CAAAA,OAAQC,CAAAA,KAAb,CACHpB,IAAKG,CAAAA,IAAKC,CAAAA,OAAQW,CAAAA,SADf,EAC0BG,KAD1B,EACiC,QAAQ,CAACL,GAAD,CAA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A3B;AACA,MAAIC,YAAY1D,OAAZ0D,GAAsB,EAA1B;AACA,MAAI3E,MAAM,IAAKnE,CAAAA,KAAMF,CAAAA,MAAjBqE,GAA0B0E,SAA9B;AACA,MAAIhD,MAAM,EAAV;AACA,OAAK,IAAIhG,IAAI,CAAb,EAAgBA,CAAhB,GAAoBsE,GAApB,EAAyBtE,CAAA,EAAzB;AACE,QAAIiJ,SAAJ,GAAgB,CAAhB;AACEjD,SAAA,CAAIhG,CAAJ,CAAA,GAAU,IAAKyD,CAAAA,OAAL,CAAazD,CAAb,GAAiBgJ,SAAjB,CAAV,KAA0CC,SAA1C,GACK,IAAKxF,CAAAA,OAAL,CAAazD,CAAb,GAAiBgJ,SAAjB,GAA6B,CAA7B,CADL,IACyC,EADzC,GAC8CC,SAD9C;AADF;AAIEjD,SAAA,CAAIhG,CAAJ,CAAA,GAAS,IAAKyD,CAAAA,OAAL,CAAazD,CAAb,GAAiBgJ,SAAjB,CAAT;AAJF;AADF;AAQA,SAAO,IAAI3J,IAAKG,CAAAA,IAAKC,CAAAA,OAAd,CAAsBuG,GAAtB,EAA2B,IAAKnG,CAAAA,KAAhC,CAAP;AAdyD,CAA3D;;\",\n\"sources\":[\"goog/math/integer.js\"],\n\"sourcesContent\":[\"/**\\n * @license\\n * Copyright The Closure Library Authors.\\n * SPDX-License-Identifier: Apache-2.0\\n */\\n\\n/**\\n * @fileoverview Defines an Integer class for representing (potentially)\\n * infinite length two's-complement integer values.\\n *\\n * For the specific case of 64-bit integers, use goog.math.Long, which is more\\n * efficient.\\n */\\n\\ngoog.provide('goog.math.Integer');\\n\\ngoog.require('goog.reflect');\\n\\n/**\\n * Constructs a two's-complement integer an array containing bits of the\\n * integer in 32-bit (signed) pieces, given in little-endian order (i.e.,\\n * lowest-order bits in the first piece), and the sign of -1 or 0.\\n *\\n * See the from* functions below for other convenient ways of constructing\\n * Integers.\\n *\\n * The internal representation of an integer is an array of 32-bit signed\\n * pieces, along with a sign (0 or -1) that indicates the contents of all the\\n * other 32-bit pieces out to infinity. We use 32-bit pieces because these are\\n * the size of integers on which JavaScript performs bit-operations. For\\n * operations like addition and multiplication, we split each number into 16-bit\\n * pieces, which can easily be multiplied within JavaScript's floating-point\\n * representation without overflow or change in sign.\\n *\\n * @struct\\n * @constructor\\n * @param {Array<number>} bits Array containing the bits of the number.\\n * @param {number} sign The sign of the number: -1 for negative and 0 positive.\\n * @final\\n */\\ngoog.math.Integer = function(bits, sign) {\\n 'use strict';\\n /**\\n * @type {number}\\n * @private\\n */\\n this.sign_ = sign;\\n\\n // Note: using a local variable while initializing the array helps the\\n // compiler understand that assigning to the array is local side-effect and\\n // that enables the entire constructor to be seen as side-effect free.\\n var localBits = [];\\n\\n // Copy the 32-bit signed integer values passed in. We prune out those at the\\n // top that equal the sign since they are redundant.\\n var top = true;\\n\\n for (var i = bits.length - 1; i >= 0; i--) {\\n var val = bits[i] | 0;\\n if (!top || val != sign) {\\n localBits[i] = val;\\n top = false;\\n }\\n }\\n\\n /**\\n * @type {!Array<number>}\\n * @private\\n * @const\\n */\\n this.bits_ = localBits;\\n};\\n\\n\\n// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\\n// from* methods on which they depend.\\n\\n\\n/**\\n * A cache of the Integer representations of small integer values.\\n * @type {!Object<number, !goog.math.Integer>}\\n * @private\\n */\\ngoog.math.Integer.IntCache_ = {};\\n\\n\\n/**\\n * Returns an Integer representing the given (32-bit) integer value.\\n * @param {number} value A 32-bit integer value.\\n * @return {!goog.math.Integer} The corresponding Integer value.\\n */\\ngoog.math.Integer.fromInt = function(value) {\\n 'use strict';\\n if (-128 <= value && value < 128) {\\n return goog.reflect.cache(\\n goog.math.Integer.IntCache_, value, function(val) {\\n 'use strict';\\n return new goog.math.Integer([val | 0], val < 0 ? -1 : 0);\\n });\\n }\\n return new goog.math.Integer([value | 0], value < 0 ? -1 : 0);\\n};\\n\\n\\n/**\\n * Returns an Integer representing the given value, provided that it is a finite\\n * number. Otherwise, zero is returned.\\n * @param {number} value The value in question.\\n * @return {!goog.math.Integer} The corresponding Integer value.\\n */\\ngoog.math.Integer.fromNumber = function(value) {\\n 'use strict';\\n if (isNaN(value) || !isFinite(value)) {\\n return goog.math.Integer.ZERO;\\n } else if (value < 0) {\\n return goog.math.Integer.fromNumber(-value).negate();\\n } else {\\n var bits = [];\\n var pow = 1;\\n for (var i = 0; value >= pow; i++) {\\n bits[i] = (value / pow) | 0;\\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\\n }\\n return new goog.math.Integer(bits, 0);\\n }\\n};\\n\\n\\n/**\\n * Returns a Integer representing the value that comes by concatenating the\\n * given entries, each is assumed to be 32 signed bits, given in little-endian\\n * order (lowest order bits in the lowest index), and sign-extending the highest\\n * order 32-bit value.\\n * @param {Array<number>} bits The bits of the number, in 32-bit signed pieces,\\n * in little-endian order.\\n * @return {!goog.math.Integer} The corresponding Integer value.\\n */\\ngoog.math.Integer.fromBits = function(bits) {\\n 'use strict';\\n var high = bits[bits.length - 1];\\n return new goog.math.Integer(bits, high & (1 << 31) ? -1 : 0);\\n};\\n\\n\\n/**\\n * Returns an Integer representation of the given string, written using the\\n * given radix.\\n * @param {string} str The textual representation of the Integer.\\n * @param {number=} opt_radix The radix in which the text is written.\\n * @return {!goog.math.Integer} The corresponding Integer value.\\n */\\ngoog.math.Integer.fromString = function(str, opt_radix) {\\n 'use strict';\\n if (str.length == 0) {\\n throw new Error('number format error: empty string');\\n }\\n\\n var radix = opt_radix || 10;\\n if (radix < 2 || 36 < radix) {\\n throw new Error('radix out of range: ' + radix);\\n }\\n\\n if (str.charAt(0) == '-') {\\n return goog.math.Integer.fromString(str.substring(1), radix).negate();\\n } else if (str.indexOf('-') >= 0) {\\n throw new Error('number format error: interior \\\"-\\\" character');\\n }\\n\\n // Do several (8) digits each time through the loop, so as to\\n // minimize the calls to the very expensive emulated div.\\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 8));\\n\\n var result = goog.math.Integer.ZERO;\\n for (var i = 0; i < str.length; i += 8) {\\n var size = Math.min(8, str.length - i);\\n var value = parseInt(str.substring(i, i + size), radix);\\n if (size < 8) {\\n var power = goog.math.Integer.fromNumber(Math.pow(radix, size));\\n result = result.multiply(power).add(goog.math.Integer.fromNumber(value));\\n } else {\\n result = result.multiply(radixToPower);\\n result = result.add(goog.math.Integer.fromNumber(value));\\n }\\n }\\n return result;\\n};\\n\\n\\n/**\\n * A number used repeatedly in calculations. This must appear before the first\\n * call to the from* functions below.\\n * @type {number}\\n * @private\\n */\\ngoog.math.Integer.TWO_PWR_32_DBL_ = (1 << 16) * (1 << 16);\\n\\n\\n/** @type {!goog.math.Integer} */\\ngoog.math.Integer.ZERO = goog.math.Integer.fromInt(0);\\n\\n/** @type {!goog.math.Integer} */\\ngoog.math.Integer.ONE = goog.math.Integer.fromInt(1);\\n\\n\\n/**\\n * @const\\n * @type {!goog.math.Integer}\\n * @private\\n */\\ngoog.math.Integer.TWO_PWR_24_ = goog.math.Integer.fromInt(1 << 24);\\n\\n/**\\n * Returns the value, assuming it is a 32-bit integer.\\n * @return {number} The corresponding int value.\\n */\\ngoog.math.Integer.prototype.toInt = function() {\\n 'use strict';\\n return this.bits_.length > 0 ? this.bits_[0] : this.sign_;\\n};\\n\\n\\n/** @return {number} The closest floating-point representation to this value. */\\ngoog.math.Integer.prototype.toNumber = function() {\\n 'use strict';\\n if (this.isNegative()) {\\n return -this.negate().toNumber();\\n } else {\\n var val = 0;\\n var pow = 1;\\n for (var i = 0; i < this.bits_.length; i++) {\\n val += this.getBitsUnsigned(i) * pow;\\n pow *= goog.math.Integer.TWO_PWR_32_DBL_;\\n }\\n return val;\\n }\\n};\\n\\n\\n/**\\n * @param {number=} opt_radix The radix in which the text should be written.\\n * @return {string} The textual representation of this value.\\n * @override\\n */\\ngoog.math.Integer.prototype.toString = function(opt_radix) {\\n 'use strict';\\n var radix = opt_radix || 10;\\n if (radix < 2 || 36 < radix) {\\n throw new Error('radix out of range: ' + radix);\\n }\\n\\n if (this.isZero()) {\\n return '0';\\n } else if (this.isNegative()) {\\n return '-' + this.negate().toString(radix);\\n }\\n\\n // Do several (6) digits each time through the loop, so as to\\n // minimize the calls to the very expensive emulated div.\\n var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 6));\\n\\n var rem = this;\\n var result = '';\\n while (true) {\\n var remDiv = rem.divide(radixToPower);\\n // The right shifting fixes negative values in the case when\\n // intval >= 2^31; for more details see\\n // https://github.com/google/closure-library/pull/498\\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0;\\n var digits = intval.toString(radix);\\n\\n rem = remDiv;\\n if (rem.isZero()) {\\n return digits + result;\\n } else {\\n while (digits.length < 6) {\\n digits = '0' + digits;\\n }\\n result = '' + digits + result;\\n }\\n }\\n};\\n\\n\\n/**\\n * Returns the index-th 32-bit (signed) piece of the Integer according to\\n * little-endian order (i.e., index 0 contains the smallest bits).\\n * @param {number} index The index in question.\\n * @return {number} The requested 32-bits as a signed number.\\n */\\ngoog.math.Integer.prototype.getBits = function(index) {\\n 'use strict';\\n if (index < 0) {\\n return 0; // Allowing this simplifies bit shifting operations below...\\n } else if (index < this.bits_.length) {\\n return this.bits_[index];\\n } else {\\n return this.sign_;\\n }\\n};\\n\\n\\n/**\\n * Returns the index-th 32-bit piece as an unsigned number.\\n * @param {number} index The index in question.\\n * @return {number} The requested 32-bits as an unsigned number.\\n */\\ngoog.math.Integer.prototype.getBitsUnsigned = function(index) {\\n 'use strict';\\n var val = this.getBits(index);\\n return val >= 0 ? val : goog.math.Integer.TWO_PWR_32_DBL_ + val;\\n};\\n\\n\\n/** @return {number} The sign bit of this number, -1 or 0. */\\ngoog.math.Integer.prototype.getSign = function() {\\n 'use strict';\\n return this.sign_;\\n};\\n\\n\\n/** @return {boolean} Whether this value is zero. */\\ngoog.math.Integer.prototype.isZero = function() {\\n 'use strict';\\n if (this.sign_ != 0) {\\n return false;\\n }\\n for (var i = 0; i < this.bits_.length; i++) {\\n if (this.bits_[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n};\\n\\n\\n/** @return {boolean} Whether this value is negative. */\\ngoog.math.Integer.prototype.isNegative = function() {\\n 'use strict';\\n return this.sign_ == -1;\\n};\\n\\n\\n/** @return {boolean} Whether this value is odd. */\\ngoog.math.Integer.prototype.isOdd = function() {\\n 'use strict';\\n return (this.bits_.length == 0) && (this.sign_ == -1) ||\\n (this.bits_.length > 0) && ((this.bits_[0] & 1) != 0);\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer equals the other.\\n */\\ngoog.math.Integer.prototype.equals = function(other) {\\n 'use strict';\\n if (this.sign_ != other.sign_) {\\n return false;\\n }\\n var len = Math.max(this.bits_.length, other.bits_.length);\\n for (var i = 0; i < len; i++) {\\n if (this.getBits(i) != other.getBits(i)) {\\n return false;\\n }\\n }\\n return true;\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer does not equal the other.\\n */\\ngoog.math.Integer.prototype.notEquals = function(other) {\\n 'use strict';\\n return !this.equals(other);\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer is greater than the other.\\n */\\ngoog.math.Integer.prototype.greaterThan = function(other) {\\n 'use strict';\\n return this.compare(other) > 0;\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer is greater than or equal to the other.\\n */\\ngoog.math.Integer.prototype.greaterThanOrEqual = function(other) {\\n 'use strict';\\n return this.compare(other) >= 0;\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer is less than the other.\\n */\\ngoog.math.Integer.prototype.lessThan = function(other) {\\n 'use strict';\\n return this.compare(other) < 0;\\n};\\n\\n\\n/**\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {boolean} Whether this Integer is less than or equal to the other.\\n */\\ngoog.math.Integer.prototype.lessThanOrEqual = function(other) {\\n 'use strict';\\n return this.compare(other) <= 0;\\n};\\n\\n\\n/**\\n * Compares this Integer with the given one.\\n * @param {goog.math.Integer} other Integer to compare against.\\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\\n * if the given one is greater.\\n */\\ngoog.math.Integer.prototype.compare = function(other) {\\n 'use strict';\\n var diff = this.subtract(other);\\n if (diff.isNegative()) {\\n return -1;\\n } else if (diff.isZero()) {\\n return 0;\\n } else {\\n return +1;\\n }\\n};\\n\\n\\n/**\\n * Returns an integer with only the first numBits bits of this value, sign\\n * extended from the final bit.\\n * @param {number} numBits The number of bits by which to shift.\\n * @return {!goog.math.Integer} The shorted integer value.\\n */\\ngoog.math.Integer.prototype.shorten = function(numBits) {\\n 'use strict';\\n var arr_index = (numBits - 1) >> 5;\\n var bit_index = (numBits - 1) % 32;\\n var bits = [];\\n for (var i = 0; i < arr_index; i++) {\\n bits[i] = this.getBits(i);\\n }\\n var sigBits = bit_index == 31 ? 0xFFFFFFFF : (1 << (bit_index + 1)) - 1;\\n var val = this.getBits(arr_index) & sigBits;\\n if (val & (1 << bit_index)) {\\n val |= 0xFFFFFFFF - sigBits;\\n bits[arr_index] = val;\\n return new goog.math.Integer(bits, -1);\\n } else {\\n bits[arr_index] = val;\\n return new goog.math.Integer(bits, 0);\\n }\\n};\\n\\n\\n/** @return {!goog.math.Integer} The negation of this value. */\\ngoog.math.Integer.prototype.negate = function() {\\n 'use strict';\\n return this.not().add(goog.math.Integer.ONE);\\n};\\n\\n\\n/** @return {!goog.math.Integer} The absolute value of this value. */\\ngoog.math.Integer.prototype.abs = function() {\\n 'use strict';\\n return this.isNegative() ? this.negate() : this;\\n};\\n\\n\\n/**\\n * Returns the sum of this and the given Integer.\\n * @param {goog.math.Integer} other The Integer to add to this.\\n * @return {!goog.math.Integer} The Integer result.\\n */\\ngoog.math.Integer.prototype.add = function(other) {\\n 'use strict';\\n var len = Math.max(this.bits_.length, other.bits_.length);\\n var arr = [];\\n var carry = 0;\\n\\n for (var i = 0; i <= len; i++) {\\n var a1 = this.getBits(i) >>> 16;\\n var a0 = this.getBits(i) & 0xFFFF;\\n\\n var b1 = other.getBits(i) >>> 16;\\n var b0 = other.getBits(i) & 0xFFFF;\\n\\n var c0 = carry + a0 + b0;\\n var c1 = (c0 >>> 16) + a1 + b1;\\n carry = c1 >>> 16;\\n c0 &= 0xFFFF;\\n c1 &= 0xFFFF;\\n arr[i] = (c1 << 16) | c0;\\n }\\n return goog.math.Integer.fromBits(arr);\\n};\\n\\n\\n/**\\n * Returns the difference of this and the given Integer.\\n * @param {goog.math.Integer} other The Integer to subtract from this.\\n * @return {!goog.math.Integer} The Integer result.\\n */\\ngoog.math.Integer.prototype.subtract = function(other) {\\n 'use strict';\\n return this.add(other.negate());\\n};\\n\\n\\n/**\\n * Returns the product of this and the given Integer.\\n * @param {goog.math.Integer} other The Integer to multiply against this.\\n * @return {!goog.math.Integer} The product of this and the other.\\n */\\ngoog.math.Integer.prototype.multiply = function(other) {\\n 'use strict';\\n if (this.isZero()) {\\n return goog.math.Integer.ZERO;\\n } else if (other.isZero()) {\\n return goog.math.Integer.ZERO;\\n }\\n\\n if (this.isNegative()) {\\n if (other.isNegative()) {\\n return this.negate().multiply(other.negate());\\n } else {\\n return this.negate().multiply(other).negate();\\n }\\n } else if (other.isNegative()) {\\n return this.multiply(other.negate()).negate();\\n }\\n\\n // If both numbers are small, use float multiplication\\n if (this.lessThan(goog.math.Integer.TWO_PWR_24_) &&\\n other.lessThan(goog.math.Integer.TWO_PWR_24_)) {\\n return goog.math.Integer.fromNumber(this.toNumber() * other.toNumber());\\n }\\n\\n // Fill in an array of 16-bit products.\\n var len = this.bits_.length + other.bits_.length;\\n var arr = [];\\n for (var i = 0; i < 2 * len; i++) {\\n arr[i] = 0;\\n }\\n for (var i = 0; i < this.bits_.length; i++) {\\n for (var j = 0; j < other.bits_.length; j++) {\\n var a1 = this.getBits(i) >>> 16;\\n var a0 = this.getBits(i) & 0xFFFF;\\n\\n var b1 = other.getBits(j) >>> 16;\\n var b0 = other.getBits(j) & 0xFFFF;\\n\\n arr[2 * i + 2 * j] += a0 * b0;\\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j);\\n arr[2 * i + 2 * j + 1] += a1 * b0;\\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\\n arr[2 * i + 2 * j + 1] += a0 * b1;\\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\\n arr[2 * i + 2 * j + 2] += a1 * b1;\\n goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 2);\\n }\\n }\\n\\n // Combine the 16-bit values into 32-bit values.\\n for (var i = 0; i < len; i++) {\\n arr[i] = (arr[2 * i + 1] << 16) | arr[2 * i];\\n }\\n for (var i = len; i < 2 * len; i++) {\\n arr[i] = 0;\\n }\\n return new goog.math.Integer(arr, 0);\\n};\\n\\n\\n/**\\n * Carries any overflow from the given index into later entries.\\n * @param {Array<number>} bits Array of 16-bit values in little-endian order.\\n * @param {number} index The index in question.\\n * @private\\n */\\ngoog.math.Integer.carry16_ = function(bits, index) {\\n 'use strict';\\n while ((bits[index] & 0xFFFF) != bits[index]) {\\n bits[index + 1] += bits[index] >>> 16;\\n bits[index] &= 0xFFFF;\\n index++;\\n }\\n};\\n\\n\\n/**\\n * Returns \\\"this\\\" Integer divided by the given one. Both \\\"this\\\" and the given\\n * Integer MUST be positive.\\n *\\n * This method is only needed for very large numbers (>10^308),\\n * for which the original division algorithm gets into an infinite\\n * loop (see https://github.com/google/closure-library/issues/500).\\n *\\n * The algorithm has some possible performance enhancements (or\\n * could be rewritten entirely), it's just an initial solution for\\n * the issue linked above.\\n *\\n * @param {!goog.math.Integer} other The Integer to divide \\\"this\\\" by.\\n * @return {!goog.math.Integer.DivisionResult}\\n * @private\\n */\\ngoog.math.Integer.prototype.slowDivide_ = function(other) {\\n 'use strict';\\n if (this.isNegative() || other.isNegative()) {\\n throw new Error('slowDivide_ only works with positive integers.');\\n }\\n\\n var twoPower = goog.math.Integer.ONE;\\n var multiple = other;\\n\\n // First we have to figure out what the highest bit of the result\\n // is, so we increase \\\"twoPower\\\" and \\\"multiple\\\" until \\\"multiple\\\"\\n // exceeds \\\"this\\\".\\n while (multiple.lessThanOrEqual(this)) {\\n twoPower = twoPower.shiftLeft(1);\\n multiple = multiple.shiftLeft(1);\\n }\\n\\n // Rewind by one power of two, giving us the highest bit of the\\n // result.\\n var res = twoPower.shiftRight(1);\\n var total = multiple.shiftRight(1);\\n\\n // Now we starting decreasing \\\"multiple\\\" and \\\"twoPower\\\" to find the\\n // rest of the bits of the result.\\n var total2;\\n multiple = multiple.shiftRight(2);\\n twoPower = twoPower.shiftRight(2);\\n while (!multiple.isZero()) {\\n // whenever we can add \\\"multiple\\\" to the total and not exceed\\n // \\\"this\\\", that means we've found a 1 bit. Else we've found a 0\\n // and don't need to add to the result.\\n total2 = total.add(multiple);\\n if (total2.lessThanOrEqual(this)) {\\n res = res.add(twoPower);\\n total = total2;\\n }\\n multiple = multiple.shiftRight(1);\\n twoPower = twoPower.shiftRight(1);\\n }\\n\\n\\n // TODO(user): Calculate this more efficiently during the division.\\n // This is kind of a waste since it isn't always needed, but it keeps the\\n // API smooth. Since this is already a slow path it probably isn't a big deal.\\n var remainder = this.subtract(res.multiply(other));\\n return new goog.math.Integer.DivisionResult(res, remainder);\\n};\\n\\n\\n/**\\n * Returns this Integer divided by the given one.\\n * @param {!goog.math.Integer} other The Integer to divide this by.\\n * @return {!goog.math.Integer} This value divided by the given one.\\n */\\ngoog.math.Integer.prototype.divide = function(other) {\\n 'use strict';\\n return this.divideAndRemainder(other).quotient;\\n};\\n\\n\\n/**\\n * A struct for holding the quotient and remainder of a division.\\n *\\n * @constructor\\n * @final\\n * @struct\\n *\\n * @param {!goog.math.Integer} quotient\\n * @param {!goog.math.Integer} remainder\\n */\\ngoog.math.Integer.DivisionResult = function(quotient, remainder) {\\n 'use strict';\\n /** @const */\\n this.quotient = quotient;\\n\\n /** @const */\\n this.remainder = remainder;\\n};\\n\\n\\n/**\\n * Returns this Integer divided by the given one, as well as the remainder of\\n * that division.\\n *\\n * @param {!goog.math.Integer} other The Integer to divide this by.\\n * @return {!goog.math.Integer.DivisionResult}\\n */\\ngoog.math.Integer.prototype.divideAndRemainder = function(other) {\\n 'use strict';\\n if (other.isZero()) {\\n throw new Error('division by zero');\\n } else if (this.isZero()) {\\n return new goog.math.Integer.DivisionResult(\\n goog.math.Integer.ZERO, goog.math.Integer.ZERO);\\n }\\n\\n if (this.isNegative()) {\\n // Do the division on the negative of the numerator...\\n var result = this.negate().divideAndRemainder(other);\\n return new goog.math.Integer.DivisionResult(\\n // ...and flip the sign back after.\\n result.quotient.negate(),\\n // The remainder must always have the same sign as the numerator.\\n result.remainder.negate());\\n } else if (other.isNegative()) {\\n // Do the division on the negative of the denominator...\\n var result = this.divideAndRemainder(other.negate());\\n return new goog.math.Integer.DivisionResult(\\n // ...and flip the sign back after.\\n result.quotient.negate(),\\n // The remainder must always have the same sign as the numerator.\\n result.remainder);\\n }\\n\\n // Have to degrade to slowDivide for Very Large Numbers, because\\n // they're out of range for the floating-point approximation\\n // technique used below.\\n if (this.bits_.length > 30) {\\n return this.slowDivide_(other);\\n }\\n\\n // Repeat the following until the remainder is less than other: find a\\n // floating-point that approximates remainder / other *from below*, add this\\n // into the result, and subtract it from the remainder. It is critical that\\n // the approximate value is less than or equal to the real value so that the\\n // remainder never becomes negative.\\n var res = goog.math.Integer.ZERO;\\n var rem = this;\\n while (rem.greaterThanOrEqual(other)) {\\n // Approximate the result of division. This may be a little greater or\\n // smaller than the actual value.\\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\\n\\n // We will tweak the approximate result by changing it in the 48-th digit or\\n // the smallest non-fractional digit, whichever is larger.\\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\\n\\n // Decrease the approximation until it is smaller than the remainder. Note\\n // that if it is too large, the product overflows and is negative.\\n var approxRes = goog.math.Integer.fromNumber(approx);\\n var approxRem = approxRes.multiply(other);\\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\\n approx -= delta;\\n approxRes = goog.math.Integer.fromNumber(approx);\\n approxRem = approxRes.multiply(other);\\n }\\n\\n // We know the answer can't be zero... and actually, zero would cause\\n // infinite recursion since we would make no progress.\\n if (approxRes.isZero()) {\\n approxRes = goog.math.Integer.ONE;\\n }\\n\\n res = res.add(approxRes);\\n rem = rem.subtract(approxRem);\\n }\\n return new goog.math.Integer.DivisionResult(res, rem);\\n};\\n\\n\\n/**\\n * Returns this Integer modulo the given one.\\n * @param {!goog.math.Integer} other The Integer by which to mod.\\n * @return {!goog.math.Integer} This value modulo the given one.\\n */\\ngoog.math.Integer.prototype.modulo = function(other) {\\n 'use strict';\\n return this.divideAndRemainder(other).remainder;\\n};\\n\\n\\n/** @return {!goog.math.Integer} The bitwise-NOT of this value. */\\ngoog.math.Integer.prototype.not = function() {\\n 'use strict';\\n var len = this.bits_.length;\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n arr[i] = ~this.bits_[i];\\n }\\n return new goog.math.Integer(arr, ~this.sign_);\\n};\\n\\n\\n/**\\n * Returns the bitwise-AND of this Integer and the given one.\\n * @param {goog.math.Integer} other The Integer to AND with this.\\n * @return {!goog.math.Integer} The bitwise-AND of this and the other.\\n */\\ngoog.math.Integer.prototype.and = function(other) {\\n 'use strict';\\n var len = Math.max(this.bits_.length, other.bits_.length);\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n arr[i] = this.getBits(i) & other.getBits(i);\\n }\\n return new goog.math.Integer(arr, this.sign_ & other.sign_);\\n};\\n\\n\\n/**\\n * Returns the bitwise-OR of this Integer and the given one.\\n * @param {goog.math.Integer} other The Integer to OR with this.\\n * @return {!goog.math.Integer} The bitwise-OR of this and the other.\\n */\\ngoog.math.Integer.prototype.or = function(other) {\\n 'use strict';\\n var len = Math.max(this.bits_.length, other.bits_.length);\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n arr[i] = this.getBits(i) | other.getBits(i);\\n }\\n return new goog.math.Integer(arr, this.sign_ | other.sign_);\\n};\\n\\n\\n/**\\n * Returns the bitwise-XOR of this Integer and the given one.\\n * @param {goog.math.Integer} other The Integer to XOR with this.\\n * @return {!goog.math.Integer} The bitwise-XOR of this and the other.\\n */\\ngoog.math.Integer.prototype.xor = function(other) {\\n 'use strict';\\n var len = Math.max(this.bits_.length, other.bits_.length);\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n arr[i] = this.getBits(i) ^ other.getBits(i);\\n }\\n return new goog.math.Integer(arr, this.sign_ ^ other.sign_);\\n};\\n\\n\\n/**\\n * Returns this value with bits shifted to the left by the given amount.\\n * @param {number} numBits The number of bits by which to shift.\\n * @return {!goog.math.Integer} This shifted to the left by the given amount.\\n */\\ngoog.math.Integer.prototype.shiftLeft = function(numBits) {\\n 'use strict';\\n var arr_delta = numBits >> 5;\\n var bit_delta = numBits % 32;\\n var len = this.bits_.length + arr_delta + (bit_delta > 0 ? 1 : 0);\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n if (bit_delta > 0) {\\n arr[i] = (this.getBits(i - arr_delta) << bit_delta) |\\n (this.getBits(i - arr_delta - 1) >>> (32 - bit_delta));\\n } else {\\n arr[i] = this.getBits(i - arr_delta);\\n }\\n }\\n return new goog.math.Integer(arr, this.sign_);\\n};\\n\\n\\n/**\\n * Returns this value with bits shifted to the right by the given amount.\\n * @param {number} numBits The number of bits by which to shift.\\n * @return {!goog.math.Integer} This shifted to the right by the given amount.\\n */\\ngoog.math.Integer.prototype.shiftRight = function(numBits) {\\n 'use strict';\\n var arr_delta = numBits >> 5;\\n var bit_delta = numBits % 32;\\n var len = this.bits_.length - arr_delta;\\n var arr = [];\\n for (var i = 0; i < len; i++) {\\n if (bit_delta > 0) {\\n arr[i] = (this.getBits(i + arr_delta) >>> bit_delta) |\\n (this.getBits(i + arr_delta + 1) << (32 - bit_delta));\\n } else {\\n arr[i] = this.getBits(i + arr_delta);\\n }\\n }\\n return new goog.math.Integer(arr, this.sign_);\\n};\\n\"],\n\"names\":[\"goog\",\"provide\",\"require\",\"math\",\"Integer\",\"goog.math.Integer\",\"bits\",\"sign\",\"sign_\",\"localBits\",\"top\",\"i\",\"length\",\"val\",\"bits_\",\"IntCache_\",\"fromInt\",\"goog.math.Integer.fromInt\",\"value\",\"reflect\",\"cache\",\"fromNumber\",\"goog.math.Integer.fromNumber\",\"isNaN\",\"isFinite\",\"ZERO\",\"negate\",\"pow\",\"TWO_PWR_32_DBL_\",\"fromBits\",\"goog.math.Integer.fromBits\",\"high\",\"fromString\",\"goog.math.Integer.fromString\",\"str\",\"opt_radix\",\"Error\",\"radix\",\"charAt\",\"substring\",\"indexOf\",\"radixToPower\",\"Math\",\"result\",\"size\",\"min\",\"parseInt\",\"power\",\"multiply\",\"add\",\"ONE\",\"TWO_PWR_24_\",\"prototype\",\"toInt\",\"goog.math.Integer.prototype.toInt\",\"toNumber\",\"goog.math.Integer.prototype.toNumber\",\"isNegative\",\"getBitsUnsigned\",\"toString\",\"goog.math.Integer.prototype.toString\",\"isZero\",\"rem\",\"remDiv\",\"divide\",\"intval\",\"subtract\",\"digits\",\"getBits\",\"goog.math.Integer.prototype.getBits\",\"index\",\"goog.math.Integer.prototype.getBitsUnsigned\",\"getSign\",\"goog.math.Integer.prototype.getSign\",\"goog.math.Integer.prototype.isZero\",\"goog.math.Integer.prototype.isNegative\",\"isOdd\",\"goog.math.Integer.prototype.isOdd\",\"equals\",\"goog.math.Integer.prototype.equals\",\"other\",\"len\",\"max\",\"notEquals\",\"goog.math.Integer.prototype.notEquals\",\"greaterThan\",\"goog.math.Integer.prototype.greaterThan\",\"compare\",\"greaterThanOrEqual\",\"goog.math.Integer.prototype.greaterThanOrEqual\",\"lessThan\",\"goog.math.Integer.prototype.lessThan\",\"lessThanOrEqual\",\"goog.math.Integer.prototype.lessThanOrEqual\",\"goog.math.Integer.prototype.compare\",\"diff\",\"shorten\",\"goog.math.Integer.prototype.shorten\",\"numBits\",\"arr_index\",\"bit_index\",\"sigBits\",\"goog.math.Integer.prototype.negate\",\"not\",\"abs\",\"goog.math.Integer.prototype.abs\",\"goog.math.Integer.prototype.add\",\"arr\",\"carry\",\"a1\",\"a0\",\"b1\",\"b0\",\"c0\",\"c1\",\"goog.math.Integer.prototype.subtract\",\"goog.math.Integer.prototype.multiply\",\"j\",\"carry16_\",\"goog.math.Integer.carry16_\",\"slowDivide_\",\"goog.math.Integer.prototype.slowDivide_\",\"twoPower\",\"multiple\",\"shiftLeft\",\"res\",\"shiftRight\",\"total\",\"total2\",\"remainder\",\"DivisionResult\",\"goog.math.Integer.prototype.divide\",\"divideAndRemainder\",\"quotient\",\"goog.math.Integer.DivisionResult\",\"goog.math.Integer.prototype.divideAndRemainder\",\"approx\",\"floor\",\"log2\",\"ceil\",\"log\",\"LN2\",\"delta\",\"approxRes\",\"approxRem\",\"modulo\",\"goog.math.Integer.prototype.modulo\",\"goog.math.Integer.prototype.not\",\"and\",\"goog.math.Integer.prototype.and\",\"or\",\"goog.math.Integer.prototype.or\",\"xor\",\"goog.math.Integer.prototype.xor\",\"goog.math.Integer.prototype.shiftLeft\",\"arr_delta\",\"bit_delta\",\"goog.math.Integer.prototype.shiftRight\"]\n}\n"] |