+115
-102
@@ -470,3 +470,3 @@ /** | ||
| * @param {number} value Number value | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults `false` for signed | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed | ||
| * @returns {!IntN} | ||
@@ -612,3 +612,3 @@ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER | ||
| bytes[i] = 0xff; | ||
| bytes[++i /* !k */] = (bytes[i] << (7-numBits)) & 0xff; | ||
| bytes[++i] = (bytes[i] << (7-numBits)) & 0xff; | ||
| } | ||
@@ -628,3 +628,3 @@ var idx; | ||
| * @param {!IntN|number} numBits Number of bits | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Shifted | ||
| * @expose | ||
@@ -655,3 +655,3 @@ */ | ||
| IntN.prototype.set = function(i, isSet) { | ||
| if (this.isSet(i) == isSet) | ||
| if (i >= nBits || this.isSet(i) == isSet) | ||
| return this; | ||
@@ -666,17 +666,30 @@ var bytes = this.bytes.slice(); | ||
| /** | ||
| * Returns the number of bits required to fully represent this IntN's value. | ||
| * @returns {number} Shift of the most significant bit (0 to N) | ||
| * @expose | ||
| */ | ||
| IntN.prototype.size = function() { | ||
| for (var i=maxIndex, byt, j=1; i>=0; --i) | ||
| if ((byt = this.bytes[i]) !== 0) { | ||
| while (byt >>= 1) | ||
| j++; | ||
| return i*8 + j; | ||
| } | ||
| return 0; | ||
| }; | ||
| // Arithmetic operations | ||
| /** | ||
| * Adds the specified IntNs and returns the sum. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * Adds the specified IntNs. Does not type check arguments. | ||
| * @param {!IntN} augend Augend | ||
| * @param {!IntN} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.add = function(a, b) { | ||
| var carry = a.and(b), | ||
| result = a.xor(b), | ||
| IntN.add = function(augend, addend) { | ||
| var carry = augend.and(addend), | ||
| result = augend.xor(addend), | ||
| carryPwr2; | ||
| // There seem to be no performance benefits testing against == 0 or == 1 (test probably too costly in avg). | ||
| // Thus, such optimization should be implemented by the user explicitly where these cases are likely. | ||
| while (!carry.isZero()) | ||
@@ -690,16 +703,16 @@ carryPwr2 = carry.shiftLeft(1), | ||
| /** | ||
| * Adds the specified to this IntN and returns the sum. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * Adds the specified to this IntN. | ||
| * @param {!IntN|number|string} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.prototype.add = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other); | ||
| IntN.prototype.add = function(addend) { | ||
| if (!IntN.isIntN(addend)) | ||
| addend = IntN.valueOf(addend); | ||
| return IntN.add(this, addend); | ||
| }; | ||
| /** | ||
| * Negates this IntN (*-1) and returns the result. | ||
| * @returns {!IntN} | ||
| * Negates this IntN (*-1). | ||
| * @returns {!IntN} Negation | ||
| * @expose | ||
@@ -720,11 +733,22 @@ */ | ||
| /** | ||
| * Subtracts the second from the first specified IntN. Does not type check arguments. | ||
| * @param {!IntN} minuend Minuend | ||
| * @param {!IntN} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.subtract = function(minuend, subtrahend) { | ||
| return IntN.add(minuend, subtrahend.negate()); | ||
| }; | ||
| /** | ||
| * Subtracts the specified from this IntN and returns the difference. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.prototype.subtract = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other.negate()); | ||
| IntN.prototype.subtract = function(subtrahend) { | ||
| if (!IntN.isIntN(subtrahend)) | ||
| subtrahend = IntN.valueOf(subtrahend); | ||
| return IntN.subtract(this, subtrahend); | ||
| }; | ||
@@ -734,3 +758,3 @@ | ||
| * Returns this IntN's absolute value as an unsigned IntN. | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Absolute | ||
| * @expose | ||
@@ -746,17 +770,21 @@ */ | ||
| * Multiplies the specified IntNs and returns the product. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * @param {!IntN} multiplicand Multiplicand | ||
| * @param {!IntN} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.multiply = function(a, b) { | ||
| // See comment in add above | ||
| var isNegative = a.isNegative() !== b.isNegative(), | ||
| result = a.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| a = a.absolute(); | ||
| b = b.absolute(); | ||
| for(;!b.isZero(); a=a.shiftLeft(1), b=b.shiftRight(1, true)) | ||
| if ((b.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, a); | ||
| return isNegative ? result.negate() : result; | ||
| IntN.multiply = function(multiplicand, multiplier) { | ||
| var result = multiplicand.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| var m = multiplicand.absolute(), | ||
| n = multiplier.absolute(); | ||
| while (!n.isZero()) { | ||
| if ((n.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, m); | ||
| m = m.shiftLeft(1); | ||
| n = n.shiftRight(1, true); | ||
| } | ||
| if (!multiplicand.unsigned) | ||
| if (multiplicand.isNegative() !== multiplier.isNegative()) | ||
| result = result.negate(); | ||
| return result; | ||
| }; | ||
@@ -766,10 +794,10 @@ | ||
| * Multiplies this IntN with the specified and returns the product. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.prototype.multiply = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.multiply(this, other); | ||
| IntN.prototype.multiply = function(multiplier) { | ||
| if (!IntN.isIntN(multiplier)) | ||
| multiplier = IntN.valueOf(multiplier); | ||
| return IntN.multiply(this, multiplier); | ||
| }; | ||
@@ -780,5 +808,5 @@ | ||
| * not type check arguments. | ||
| * @param {!IntN} dividend | ||
| * @param {!IntN} divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} | ||
| * @param {!IntN} dividend Dividend | ||
| * @param {!IntN} divisor Divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} Quotient and remainder | ||
| * @expose | ||
@@ -791,38 +819,24 @@ */ | ||
| divisor = divisor.toUnsigned(); | ||
| if (dividend.unsigned && dividend.greaterThan(IntN.MAX_VALUE)) { | ||
| // Ensure correct results for large unsigned values. TODO: Is there a better way? | ||
| var IntM = makeIntN(nBits+8), // constructed when requested, then reused | ||
| divmod = IntM.divide(dividend.cast(IntM), divisor.cast(IntM)); | ||
| return { | ||
| "quotient": divmod['quotient'].cast(IntN), | ||
| "remainder": divmod['remainder'].cast(IntN) | ||
| }; | ||
| var n = dividend.absolute(), | ||
| d = divisor.absolute(), | ||
| q = IntN.UZERO, | ||
| r = IntN.UZERO; | ||
| for (var i=n.size()-1; i>=0; --i) { | ||
| r = r.shiftLeft(1); | ||
| r = r.set(0, n.isSet(i)); | ||
| if (r.greaterThanEqual(d)) | ||
| r = IntN.add(r, d.negate()), | ||
| q = q.set(i, true); | ||
| } | ||
| var isNegative = dividend.isNegative() !== divisor.isNegative(), | ||
| quotient = IntN.UZERO, | ||
| remainder = dividend.absolute(), | ||
| product = divisor.absolute(), | ||
| term = IntN.UONE, | ||
| termMsb = 1; | ||
| while (termMsb < nBits && product.lessThan(remainder)) | ||
| product = product.shiftLeft(1), | ||
| ++termMsb; | ||
| term = term.shiftLeft(termMsb-1); | ||
| while (term.greaterThanEqual(IntN.UONE)) { | ||
| if (product.lessThanEqual(remainder)) | ||
| quotient = IntN.add(quotient, term), | ||
| remainder = IntN.add(remainder, product.negate()); | ||
| product = product.shiftRight(1, true); | ||
| term = term.shiftRight(1, true); | ||
| if (!dividend.unsigned) { | ||
| q = q.toSigned(); | ||
| r = r.toSigned(); | ||
| if (dividend.isNegative() !== divisor.isNegative()) | ||
| q = q.negate(); | ||
| if (dividend.isNegative()) | ||
| r = r.negate(); | ||
| } | ||
| if (!dividend.unsigned) | ||
| quotient = quotient.toSigned(), | ||
| remainder = remainder.toSigned(); | ||
| if (isNegative) | ||
| quotient = quotient.negate(); | ||
| if (dividend.isNegative() || (quotient.isNegative() !== divisor.isNegative() && !quotient.isZero())) | ||
| remainder = remainder.negate(); // remainder = dividend - quotient*divisor | ||
| return { | ||
| "quotient": quotient, | ||
| "remainder": remainder | ||
| "quotient": q, | ||
| "remainder": r | ||
| }; | ||
@@ -833,10 +847,10 @@ }; | ||
| * Divides this IntN by the specified and returns the quotient. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Quotient | ||
| * @expose | ||
| */ | ||
| IntN.prototype.divide = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['quotient']; | ||
| IntN.prototype.divide = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['quotient']; | ||
| }; | ||
@@ -846,10 +860,10 @@ | ||
| * Divides this IntN by the specified and returns the remainder. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Remainder | ||
| * @expose | ||
| */ | ||
| IntN.prototype.modulo = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['remainder']; | ||
| IntN.prototype.modulo = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['remainder']; | ||
| }; | ||
@@ -860,7 +874,7 @@ | ||
| * testing and debugging, followed by the character `U` if unsigned. | ||
| * @param {boolean=} spaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @param {boolean=} addSpaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @returns {string} | ||
| * @expose | ||
| */ | ||
| IntN.prototype.toDebug = function(spaces) { | ||
| IntN.prototype.toDebug = function(addSpaces) { | ||
| for (var i=maxIndex, byt, out=""; i>=0; --i) { | ||
@@ -871,7 +885,7 @@ byt = this.bytes[i].toString(2); | ||
| out += byt; | ||
| if (spaces && i > 0) | ||
| if (addSpaces && i > 0) | ||
| out += ' '; | ||
| } | ||
| if (this.unsigned) | ||
| out += spaces ? " U" : 'U'; | ||
| out += addSpaces ? " U" : 'U'; | ||
| return out; | ||
@@ -961,3 +975,3 @@ }; | ||
| // now always gt 0: | ||
| var result = this, | ||
| var result = this.toUnsigned(), | ||
| digits = [], | ||
@@ -1051,3 +1065,2 @@ divmod; | ||
| 'shiftRightUnsigned': ['rshu', 'rightShiftUnsigned', '>>>'], | ||
| 'isSet': ['is'], | ||
| // Arithmetic operations | ||
@@ -1054,0 +1067,0 @@ 'add': ['plus', '+'], |
+115
-102
@@ -488,3 +488,3 @@ /* | ||
| * @param {number} value Number value | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults `false` for signed | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed | ||
| * @returns {!IntN} | ||
@@ -630,3 +630,3 @@ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER | ||
| bytes[i] = 0xff; | ||
| bytes[++i /* !k */] = (bytes[i] << (7-numBits)) & 0xff; | ||
| bytes[++i] = (bytes[i] << (7-numBits)) & 0xff; | ||
| } | ||
@@ -646,3 +646,3 @@ var idx; | ||
| * @param {!IntN|number} numBits Number of bits | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Shifted | ||
| * @expose | ||
@@ -673,3 +673,3 @@ */ | ||
| IntN.prototype.set = function(i, isSet) { | ||
| if (this.isSet(i) == isSet) | ||
| if (i >= nBits || this.isSet(i) == isSet) | ||
| return this; | ||
@@ -684,17 +684,30 @@ var bytes = this.bytes.slice(); | ||
| /** | ||
| * Returns the number of bits required to fully represent this IntN's value. | ||
| * @returns {number} Shift of the most significant bit (0 to N) | ||
| * @expose | ||
| */ | ||
| IntN.prototype.size = function() { | ||
| for (var i=maxIndex, byt, j=1; i>=0; --i) | ||
| if ((byt = this.bytes[i]) !== 0) { | ||
| while (byt >>= 1) | ||
| j++; | ||
| return i*8 + j; | ||
| } | ||
| return 0; | ||
| }; | ||
| // Arithmetic operations | ||
| /** | ||
| * Adds the specified IntNs and returns the sum. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * Adds the specified IntNs. Does not type check arguments. | ||
| * @param {!IntN} augend Augend | ||
| * @param {!IntN} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.add = function(a, b) { | ||
| var carry = a.and(b), | ||
| result = a.xor(b), | ||
| IntN.add = function(augend, addend) { | ||
| var carry = augend.and(addend), | ||
| result = augend.xor(addend), | ||
| carryPwr2; | ||
| // There seem to be no performance benefits testing against == 0 or == 1 (test probably too costly in avg). | ||
| // Thus, such optimization should be implemented by the user explicitly where these cases are likely. | ||
| while (!carry.isZero()) | ||
@@ -708,16 +721,16 @@ carryPwr2 = carry.shiftLeft(1), | ||
| /** | ||
| * Adds the specified to this IntN and returns the sum. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * Adds the specified to this IntN. | ||
| * @param {!IntN|number|string} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.prototype.add = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other); | ||
| IntN.prototype.add = function(addend) { | ||
| if (!IntN.isIntN(addend)) | ||
| addend = IntN.valueOf(addend); | ||
| return IntN.add(this, addend); | ||
| }; | ||
| /** | ||
| * Negates this IntN (*-1) and returns the result. | ||
| * @returns {!IntN} | ||
| * Negates this IntN (*-1). | ||
| * @returns {!IntN} Negation | ||
| * @expose | ||
@@ -738,11 +751,22 @@ */ | ||
| /** | ||
| * Subtracts the second from the first specified IntN. Does not type check arguments. | ||
| * @param {!IntN} minuend Minuend | ||
| * @param {!IntN} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.subtract = function(minuend, subtrahend) { | ||
| return IntN.add(minuend, subtrahend.negate()); | ||
| }; | ||
| /** | ||
| * Subtracts the specified from this IntN and returns the difference. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.prototype.subtract = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other.negate()); | ||
| IntN.prototype.subtract = function(subtrahend) { | ||
| if (!IntN.isIntN(subtrahend)) | ||
| subtrahend = IntN.valueOf(subtrahend); | ||
| return IntN.subtract(this, subtrahend); | ||
| }; | ||
@@ -752,3 +776,3 @@ | ||
| * Returns this IntN's absolute value as an unsigned IntN. | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Absolute | ||
| * @expose | ||
@@ -764,17 +788,21 @@ */ | ||
| * Multiplies the specified IntNs and returns the product. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * @param {!IntN} multiplicand Multiplicand | ||
| * @param {!IntN} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.multiply = function(a, b) { | ||
| // See comment in add above | ||
| var isNegative = a.isNegative() !== b.isNegative(), | ||
| result = a.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| a = a.absolute(); | ||
| b = b.absolute(); | ||
| for(;!b.isZero(); a=a.shiftLeft(1), b=b.shiftRight(1, true)) | ||
| if ((b.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, a); | ||
| return isNegative ? result.negate() : result; | ||
| IntN.multiply = function(multiplicand, multiplier) { | ||
| var result = multiplicand.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| var m = multiplicand.absolute(), | ||
| n = multiplier.absolute(); | ||
| while (!n.isZero()) { | ||
| if ((n.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, m); | ||
| m = m.shiftLeft(1); | ||
| n = n.shiftRight(1, true); | ||
| } | ||
| if (!multiplicand.unsigned) | ||
| if (multiplicand.isNegative() !== multiplier.isNegative()) | ||
| result = result.negate(); | ||
| return result; | ||
| }; | ||
@@ -784,10 +812,10 @@ | ||
| * Multiplies this IntN with the specified and returns the product. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.prototype.multiply = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.multiply(this, other); | ||
| IntN.prototype.multiply = function(multiplier) { | ||
| if (!IntN.isIntN(multiplier)) | ||
| multiplier = IntN.valueOf(multiplier); | ||
| return IntN.multiply(this, multiplier); | ||
| }; | ||
@@ -798,5 +826,5 @@ | ||
| * not type check arguments. | ||
| * @param {!IntN} dividend | ||
| * @param {!IntN} divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} | ||
| * @param {!IntN} dividend Dividend | ||
| * @param {!IntN} divisor Divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} Quotient and remainder | ||
| * @expose | ||
@@ -809,38 +837,24 @@ */ | ||
| divisor = divisor.toUnsigned(); | ||
| if (dividend.unsigned && dividend.greaterThan(IntN.MAX_VALUE)) { | ||
| // Ensure correct results for large unsigned values. TODO: Is there a better way? | ||
| var IntM = makeIntN(nBits+8), // constructed when requested, then reused | ||
| divmod = IntM.divide(dividend.cast(IntM), divisor.cast(IntM)); | ||
| return { | ||
| "quotient": divmod['quotient'].cast(IntN), | ||
| "remainder": divmod['remainder'].cast(IntN) | ||
| }; | ||
| var n = dividend.absolute(), | ||
| d = divisor.absolute(), | ||
| q = IntN.UZERO, | ||
| r = IntN.UZERO; | ||
| for (var i=n.size()-1; i>=0; --i) { | ||
| r = r.shiftLeft(1); | ||
| r = r.set(0, n.isSet(i)); | ||
| if (r.greaterThanEqual(d)) | ||
| r = IntN.add(r, d.negate()), | ||
| q = q.set(i, true); | ||
| } | ||
| var isNegative = dividend.isNegative() !== divisor.isNegative(), | ||
| quotient = IntN.UZERO, | ||
| remainder = dividend.absolute(), | ||
| product = divisor.absolute(), | ||
| term = IntN.UONE, | ||
| termMsb = 1; | ||
| while (termMsb < nBits && product.lessThan(remainder)) | ||
| product = product.shiftLeft(1), | ||
| ++termMsb; | ||
| term = term.shiftLeft(termMsb-1); | ||
| while (term.greaterThanEqual(IntN.UONE)) { | ||
| if (product.lessThanEqual(remainder)) | ||
| quotient = IntN.add(quotient, term), | ||
| remainder = IntN.add(remainder, product.negate()); | ||
| product = product.shiftRight(1, true); | ||
| term = term.shiftRight(1, true); | ||
| if (!dividend.unsigned) { | ||
| q = q.toSigned(); | ||
| r = r.toSigned(); | ||
| if (dividend.isNegative() !== divisor.isNegative()) | ||
| q = q.negate(); | ||
| if (dividend.isNegative()) | ||
| r = r.negate(); | ||
| } | ||
| if (!dividend.unsigned) | ||
| quotient = quotient.toSigned(), | ||
| remainder = remainder.toSigned(); | ||
| if (isNegative) | ||
| quotient = quotient.negate(); | ||
| if (dividend.isNegative() || (quotient.isNegative() !== divisor.isNegative() && !quotient.isZero())) | ||
| remainder = remainder.negate(); // remainder = dividend - quotient*divisor | ||
| return { | ||
| "quotient": quotient, | ||
| "remainder": remainder | ||
| "quotient": q, | ||
| "remainder": r | ||
| }; | ||
@@ -851,10 +865,10 @@ }; | ||
| * Divides this IntN by the specified and returns the quotient. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Quotient | ||
| * @expose | ||
| */ | ||
| IntN.prototype.divide = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['quotient']; | ||
| IntN.prototype.divide = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['quotient']; | ||
| }; | ||
@@ -864,10 +878,10 @@ | ||
| * Divides this IntN by the specified and returns the remainder. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Remainder | ||
| * @expose | ||
| */ | ||
| IntN.prototype.modulo = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['remainder']; | ||
| IntN.prototype.modulo = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['remainder']; | ||
| }; | ||
@@ -878,7 +892,7 @@ | ||
| * testing and debugging, followed by the character `U` if unsigned. | ||
| * @param {boolean=} spaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @param {boolean=} addSpaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @returns {string} | ||
| * @expose | ||
| */ | ||
| IntN.prototype.toDebug = function(spaces) { | ||
| IntN.prototype.toDebug = function(addSpaces) { | ||
| for (var i=maxIndex, byt, out=""; i>=0; --i) { | ||
@@ -889,7 +903,7 @@ byt = this.bytes[i].toString(2); | ||
| out += byt; | ||
| if (spaces && i > 0) | ||
| if (addSpaces && i > 0) | ||
| out += ' '; | ||
| } | ||
| if (this.unsigned) | ||
| out += spaces ? " U" : 'U'; | ||
| out += addSpaces ? " U" : 'U'; | ||
| return out; | ||
@@ -979,3 +993,3 @@ }; | ||
| // now always gt 0: | ||
| var result = this, | ||
| var result = this.toUnsigned(), | ||
| digits = [], | ||
@@ -1069,3 +1083,2 @@ divmod; | ||
| 'shiftRightUnsigned': ['rshu', 'rightShiftUnsigned', '>>>'], | ||
| 'isSet': ['is'], | ||
| // Arithmetic operations | ||
@@ -1072,0 +1085,0 @@ 'add': ['plus', '+'], |
+19
-19
@@ -6,20 +6,20 @@ /* | ||
| */ | ||
| (function(t){var r=function(){function r(k){function b(a,b){this.bytes=Array(f);for(var c=0,e=Math.min(f,a.length);c<e;++c)this.bytes[c]=a[c]&255;for(;c<f;++c)this.bytes[c]=0;this.unsigned=!!b}if(0>=k||0!==k%8)throw Error("illegal number of bits: "+k+" (not a positive multiple of 8)");if(u[k])return u[k];for(var f=k/8|0,n=f-1,s=Array(f),h=0;h<f;++h)s[h]=0;for(var v=Array(f),h=0;h<f;++h)v[h]=255;b.BITS=k|0;b.BYTES=f;b.isIntN=function(a){return!0===(a&&Array.isArray(a.bytes)&&a.bytes.length===f&&"boolean"=== | ||
| typeof a.unsigned)};b.valueOf=function(a){return"number"===typeof a?b.fromNumber(a):"string"===typeof a?b.fromString(a):a&&a instanceof b&&a.bytes.length===f?a:a&&"number"===typeof a.b&&"number"===typeof a.a&&"boolean"===typeof a.unsigned?b.fromInts([a.b,a.a],a.unsigned):new b(a.bytes,a.unsigned)};b.prototype.cast=function(a,b){b="boolean"===typeof b?b:this.unsigned;var c=this.isNegative(),e=c?this.not():this,e=new a(e.bytes,b);return c?e.not():e};b.ZERO=new b([],!1);b.UZERO=new b([],!0);b.ONE=new b([1], | ||
| !1);b.UONE=new b([1],!0);b.MIN_VALUE=new b(s.slice(0,f));b.MIN_VALUE.bytes[n]|=128;b.MAX_VALUE=new b(v.slice(0,f));b.MAX_VALUE.bytes[n]&=127;b.MAX_UNSIGNED_VALUE=new b(v.slice(0,f),!0);b.prototype.isSigned=function(){return!this.unsigned};b.prototype.isUnsigned=function(){return this.unsigned};b.prototype.toSigned=function(){return this.unsigned?new b(this.bytes,!1):this};b.prototype.toUnsigned=function(){return this.unsigned?this:new b(this.bytes,!0)};b.prototype.isNegative=function(){return!this.unsigned&& | ||
| 128===(this.bytes[n]&128)};b.prototype.isPositive=function(){return this.unsigned||0===(this.bytes[n]&128)};b.prototype.isEven=function(){return 0===(this.bytes[0]&1)};b.prototype.isOdd=function(){return 1===(this.bytes[0]&1)};b.prototype.isZero=function(){for(var a=0;a<f;++a)if(0!==this.bytes[a])return!1;return!0};b.prototype.compare=function(a){b.isIntN(a)||(a=b.valueOf(a));var d=this.isNegative();if(d!==a.isNegative())return d?-1:1;for(d=n;0<=d;--d){if(this.bytes[d]<a.bytes[d])return-1;if(this.bytes[d]> | ||
| a.bytes[d])return 1}return 0};b.prototype.equals=function(a){return 0===this.compare(a)};b.prototype.notEquals=function(a){return 0!==this.compare(a)};b.prototype.lessThan=function(a){return-1===this.compare(a)};b.prototype.lessThanEqual=function(a){return 0>=this.compare(a)};b.prototype.greaterThan=function(a){return 1===this.compare(a)};b.prototype.greaterThanEqual=function(a){return 0<=this.compare(a)};b.fromInt=function(a,d){a|=0;var c;if(0>a)return-2147483648===a?b.MIN_VALUE:c=b.fromInt(-a,d).negate(); | ||
| c=s.slice(0,f);for(var e=0;e<f&&0!==a;++e)c[e]=a&255,a>>>=8;return c=new b(c,d)};b.prototype.toInt=function(a){a="boolean"===typeof a?a:this.unsigned;for(var b=this.isNegative(),c=b?this.not():this,e=0,g=Math.min(4,c.bytes.length),f=0;e<g;++e)f|=c.bytes[e]<<8*e;b&&(f=~f);return a?f>>>0:f};b.fromInts=function(a,d){for(var c=b.ZERO,e=0,g=Math.min(a.length,Math.ceil(f/4)),m;e<g;++e)m=a[e],c=c.or((new b([m&255,m>>>8&255,m>>>16&255,m>>>24&255])).shiftLeft(32*e));return d?c.toUnsigned():c};b.prototype.toInts= | ||
| function(){for(var a=Math.ceil(f/4),b=Array(a),c=0,e=0,g;c<a;e=4*++c){for(var m=g=0,l=Math.min(4,f-e);m<l;++m)g|=this.bytes[e+m]<<8*m;b[c]=g}return b};b.fromNumber=function(a,d){if("number"!==typeof a)throw TypeError("illegal arguments: "+typeof a);if(a!==a||!isFinite(a)||0===a)return d?b.UZERO:b.ZERO;if(0>a)return b.fromNumber(-a,d).negate();for(var c=0,e=Array(f);c<f;++c)e[c]=a%256&255,a=Math.floor(a/256);return new b(e,d)};b.prototype.toNumber=function(){if(this.isNegative())return this.equals(b.MIN_VALUE)? | ||
| -2147483648:-this.negate().toNumber();for(var a=0,d=0,c=Math.min(f,7);a<c;++a)d+=this.bytes[a]*t[a];return d};b.prototype.not=function(){for(var a=0,d=Array(f);a<f;++a)d[a]=~this.bytes[a];return new b(d,this.unsigned)};b.prototype.and=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(f);d<f;++d)c[d]=this.bytes[d]&a.bytes[d];return new b(c,this.unsigned)};b.prototype.or=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(f);d<f;++d)c[d]=this.bytes[d]|a.bytes[d];return new b(c, | ||
| this.unsigned)};b.prototype.xor=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(f);d<f;++d)c[d]=this.bytes[d]^a.bytes[d];return new b(c,this.unsigned)};b.prototype.shiftLeft=function(a){b.isIntN(a)&&(a=a.toInt());a%=k;if(0===a)return this;0>a&&(a+=k);var d=a/8|0;a%=8;for(var c=0,e=s.slice(0,f),g;c<f&&!((g=c+d)>=f);++c)e[g]|=this.bytes[c]<<a&255,++g<f&&(e[g]|=this.bytes[c]<<a>>>8&255);return new b(e,this.unsigned)};b.prototype.shiftRight=function(a,d){b.isIntN(a)&&(a=a.toInt());a%=k; | ||
| if(0===a)return this;0>a&&(a+=k);var c=a/8|0;a%=8;var e=s.slice(0,f),g;if(!d&&128===(this.bytes[n]&128)){var m;g=f-1;for(m=f-c-1;g>=m;--g)e[g]=255;e[++g]=e[g]<<7-a&255}var l;for(g=0;g<f;++g)0<=(l=g-c)&&(e[l]|=this.bytes[g]>>>a&255),0<=--l&&(e[l]|=this.bytes[g]<<8>>>a&255);return new b(e,this.unsigned)};b.prototype.shiftRightUnsigned=function(a){return this.shiftRight(a,!0)};b.prototype.isSet=function(a){return(this.bytes[a/8|0]&(a=1<<a%8))===a};b.prototype.set=function(a,d){if(this.isSet(a)==d)return this; | ||
| var c=this.bytes.slice();c[a/8|0]=d?c[a/8|0]|1<<a%8:c[a/8|0]&255-(1<<a%8);return new b(c,this.unsigned)};b.add=function(a,b){for(var c=a.and(b),e=a.xor(b),g;!c.isZero();)g=c.shiftLeft(1),c=e.and(g),e=e.xor(g);return e};b.prototype.add=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.add(this,a)};b.prototype.negate=function(){return b.add(this.not(),b.ONE)};b.NEG_ONE=b.ONE.negate();b.prototype.subtract=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.add(this,a.negate())};b.prototype.absolute= | ||
| function(){return this.unsigned?this:(this.isNegative()?this.negate():this).toUnsigned()};b.multiply=function(a,d){var c=a.isNegative()!==d.isNegative(),e=a.unsigned?b.UZERO:b.ZERO;a=a.absolute();for(d=d.absolute();!d.isZero();a=a.shiftLeft(1),d=d.shiftRight(1,!0))1===(d.bytes[0]&1)&&(e=b.add(e,a));return c?e.negate():e};b.prototype.multiply=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.multiply(this,a)};b.divide=function(a,d){if(d.isZero())throw Error("division by zero");a.unsigned&&(d=d.toUnsigned()); | ||
| if(a.unsigned&&a.greaterThan(b.MAX_VALUE)){var c=r(k+8),c=c.divide(a.cast(c),d.cast(c));return{quotient:c.quotient.cast(b),remainder:c.remainder.cast(b)}}for(var c=a.isNegative()!==d.isNegative(),e=b.UZERO,g=a.absolute(),f=d.absolute(),l=b.UONE,h=1;h<k&&f.lessThan(g);)f=f.shiftLeft(1),++h;for(l=l.shiftLeft(h-1);l.greaterThanEqual(b.UONE);)f.lessThanEqual(g)&&(e=b.add(e,l),g=b.add(g,f.negate())),f=f.shiftRight(1,!0),l=l.shiftRight(1,!0);a.unsigned||(e=e.toSigned(),g=g.toSigned());c&&(e=e.negate()); | ||
| if(a.isNegative()||e.isNegative()!==d.isNegative()&&!e.isZero())g=g.negate();return{quotient:e,remainder:g}};b.prototype.divide=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.divide(this,a).quotient};b.prototype.modulo=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.divide(this,a).remainder};b.prototype.toDebug=function(a){for(var b=n,c,e="";0<=b;--b){for(c=this.bytes[b].toString(2);8>c.length;)c="0"+c;e+=c;a&&0<b&&(e+=" ")}this.unsigned&&(e+=a?" U":"U");return e};var w=b.fromInt(2),x=b.fromInt(36); | ||
| b.fromString=function(a,d,c){"number"===typeof d&&(c=d,d=!1);a=(a+"").toLowerCase();c=c||10;if(2>c||36<c)throw RangeError("radix out of range: "+c+" (2-36)");if("-"===a.charAt(0))return b.fromString(a.substring(1),d,c).negate();"+"===a.charAt(0)&&(a=a.substring(1));if("0"===a||"NaN"===a||"Infinity"===a)return d?b.UZERO:b.ZERO;d=d?b.UZERO:b.ZERO;for(var e=2===c?function(a){return 1<<a}:Math.pow.bind(Math,c),f=0,h=a.length,l,k;f<h;++f){l=a.charAt(h-f-1);k="0123456789abcdefghijklmnopqrstuvwxyz".indexOf(l); | ||
| if(0>k||k>c)throw Error("illegal interior character: "+l);d=b.add(d,b.multiply(b.fromInt(k),b.fromInt(e(f))))}return d};b.prototype.toString=function(a){a=a||10;b.isIntN(a)||(a=b.valueOf(a));if(a.lessThan(w)||a.greaterThan(x))throw RangeError("radix out of range: "+a.toInt()+" (2-36)");var d=this.unsigned?b.UZERO:b.ZERO;if(this.isNegative()){if(this.equals(b.MIN_VALUE)){var d=b.divide(this,a).quotient,c=b.add(b.multiply(d,a),this.negate());return d.toString(a)+c.toInt().toString(a.toInt())}return"-"+ | ||
| this.negate().toString(a)}var c=this,e=[],f;do f=b.divide(c,a),e.unshift("0123456789abcdefghijklmnopqrstuvwxyz".charAt(f.remainder.toInt())),c=b.divide(c,a).quotient;while(!c.equals(d));return e.join("")};b["isInt"+k]=b.isIntN;for(var p in q)if(q.hasOwnProperty(p)){for(h=0;h<q[p].length;++h)b[p]&&(b[q[p][h]]=b[p]);for(h=0;h<q[p].length;++h)b.prototype[p]&&(b.prototype[q[p][h]]=b.prototype[p])}return u[k]=b}var u={},t=[1,256,65536,16777216,4294967296,1099511627776,281474976710656],q={compare:["comp"], | ||
| equals:["eq","equal","=="],notEquals:["ne","notEqual","!="],lessThan:["lt","less","lesser","<"],lessThanEqual:["lte","lessThanOrEqual","<="],greaterThan:["gt","greater",">"],greaterThanEqual:["gte","greaterThanOrEqual",">="],not:["~"],and:["&"],or:["|"],xor:["^"],shiftLeft:["lsh","leftShift","<<"],shiftRight:["rsh","rightShift",">>"],shiftRightUnsigned:["rshu","rightShiftUnsigned",">>>"],isSet:["is"],add:["plus","+"],negate:["neg","!"],subtract:["sub","minus","-"],absolute:["abs","||"],multiply:["mult", | ||
| "*"],divide:["div","/"],modulo:["mod","%"]};return r}();"undefined"!==typeof module&&module.exports?module.exports=r:"function"===typeof define&&define.amd?define(function(){return r}):(t.dcodeIO=t.dcodeIO||{}).IntN=r})(this); | ||
| (function(t){var q=function(){var q={},t=[1,256,65536,16777216,4294967296,1099511627776,281474976710656],r={compare:["comp"],equals:["eq","equal","=="],notEquals:["ne","notEqual","!="],lessThan:["lt","less","lesser","<"],lessThanEqual:["lte","lessThanOrEqual","<="],greaterThan:["gt","greater",">"],greaterThanEqual:["gte","greaterThanOrEqual",">="],not:["~"],and:["&"],or:["|"],xor:["^"],shiftLeft:["lsh","leftShift","<<"],shiftRight:["rsh","rightShift",">>"],shiftRightUnsigned:["rshu","rightShiftUnsigned", | ||
| ">>>"],add:["plus","+"],negate:["neg","!"],subtract:["sub","minus","-"],absolute:["abs","||"],multiply:["mult","*"],divide:["div","/"],modulo:["mod","%"]};return function(m){function b(a,b){this.bytes=Array(e);for(var c=0,f=Math.min(e,a.length);c<f;++c)this.bytes[c]=a[c]&255;for(;c<e;++c)this.bytes[c]=0;this.unsigned=!!b}if(0>=m||0!==m%8)throw Error("illegal number of bits: "+m+" (not a positive multiple of 8)");if(q[m])return q[m];for(var e=m/8|0,n=e-1,s=Array(e),h=0;h<e;++h)s[h]=0;for(var u=Array(e), | ||
| h=0;h<e;++h)u[h]=255;b.BITS=m|0;b.BYTES=e;b.isIntN=function(a){return!0===(a&&Array.isArray(a.bytes)&&a.bytes.length===e&&"boolean"===typeof a.unsigned)};b.valueOf=function(a){return"number"===typeof a?b.fromNumber(a):"string"===typeof a?b.fromString(a):a&&a instanceof b&&a.bytes.length===e?a:a&&"number"===typeof a.b&&"number"===typeof a.a&&"boolean"===typeof a.unsigned?b.fromInts([a.b,a.a],a.unsigned):new b(a.bytes,a.unsigned)};b.prototype.cast=function(a,b){b="boolean"===typeof b?b:this.unsigned; | ||
| var c=this.isNegative(),f=c?this.not():this,f=new a(f.bytes,b);return c?f.not():f};b.ZERO=new b([],!1);b.UZERO=new b([],!0);b.ONE=new b([1],!1);b.UONE=new b([1],!0);b.MIN_VALUE=new b(s.slice(0,e));b.MIN_VALUE.bytes[n]|=128;b.MAX_VALUE=new b(u.slice(0,e));b.MAX_VALUE.bytes[n]&=127;b.MAX_UNSIGNED_VALUE=new b(u.slice(0,e),!0);b.prototype.isSigned=function(){return!this.unsigned};b.prototype.isUnsigned=function(){return this.unsigned};b.prototype.toSigned=function(){return this.unsigned?new b(this.bytes, | ||
| !1):this};b.prototype.toUnsigned=function(){return this.unsigned?this:new b(this.bytes,!0)};b.prototype.isNegative=function(){return!this.unsigned&&128===(this.bytes[n]&128)};b.prototype.isPositive=function(){return this.unsigned||0===(this.bytes[n]&128)};b.prototype.isEven=function(){return 0===(this.bytes[0]&1)};b.prototype.isOdd=function(){return 1===(this.bytes[0]&1)};b.prototype.isZero=function(){for(var a=0;a<e;++a)if(0!==this.bytes[a])return!1;return!0};b.prototype.compare=function(a){b.isIntN(a)|| | ||
| (a=b.valueOf(a));var d=this.isNegative();if(d!==a.isNegative())return d?-1:1;for(d=n;0<=d;--d){if(this.bytes[d]<a.bytes[d])return-1;if(this.bytes[d]>a.bytes[d])return 1}return 0};b.prototype.equals=function(a){return 0===this.compare(a)};b.prototype.notEquals=function(a){return 0!==this.compare(a)};b.prototype.lessThan=function(a){return-1===this.compare(a)};b.prototype.lessThanEqual=function(a){return 0>=this.compare(a)};b.prototype.greaterThan=function(a){return 1===this.compare(a)};b.prototype.greaterThanEqual= | ||
| function(a){return 0<=this.compare(a)};b.fromInt=function(a,d){a|=0;var c;if(0>a)return-2147483648===a?b.MIN_VALUE:c=b.fromInt(-a,d).negate();c=s.slice(0,e);for(var f=0;f<e&&0!==a;++f)c[f]=a&255,a>>>=8;return c=new b(c,d)};b.prototype.toInt=function(a){a="boolean"===typeof a?a:this.unsigned;for(var b=this.isNegative(),c=b?this.not():this,f=0,g=Math.min(4,c.bytes.length),e=0;f<g;++f)e|=c.bytes[f]<<8*f;b&&(e=~e);return a?e>>>0:e};b.fromInts=function(a,d){for(var c=b.ZERO,f=0,g=Math.min(a.length,Math.ceil(e/ | ||
| 4)),l;f<g;++f)l=a[f],c=c.or((new b([l&255,l>>>8&255,l>>>16&255,l>>>24&255])).shiftLeft(32*f));return d?c.toUnsigned():c};b.prototype.toInts=function(){for(var a=Math.ceil(e/4),b=Array(a),c=0,f=0,g;c<a;f=4*++c){for(var l=g=0,k=Math.min(4,e-f);l<k;++l)g|=this.bytes[f+l]<<8*l;b[c]=g}return b};b.fromNumber=function(a,d){if("number"!==typeof a)throw TypeError("illegal arguments: "+typeof a);if(a!==a||!isFinite(a)||0===a)return d?b.UZERO:b.ZERO;if(0>a)return b.fromNumber(-a,d).negate();for(var c=0,f=Array(e);c< | ||
| e;++c)f[c]=a%256&255,a=Math.floor(a/256);return new b(f,d)};b.prototype.toNumber=function(){if(this.isNegative())return this.equals(b.MIN_VALUE)?-2147483648:-this.negate().toNumber();for(var a=0,d=0,c=Math.min(e,7);a<c;++a)d+=this.bytes[a]*t[a];return d};b.prototype.not=function(){for(var a=0,d=Array(e);a<e;++a)d[a]=~this.bytes[a];return new b(d,this.unsigned)};b.prototype.and=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(e);d<e;++d)c[d]=this.bytes[d]&a.bytes[d];return new b(c,this.unsigned)}; | ||
| b.prototype.or=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(e);d<e;++d)c[d]=this.bytes[d]|a.bytes[d];return new b(c,this.unsigned)};b.prototype.xor=function(a){b.isIntN(a)||(a=b.valueOf(a));for(var d=0,c=Array(e);d<e;++d)c[d]=this.bytes[d]^a.bytes[d];return new b(c,this.unsigned)};b.prototype.shiftLeft=function(a){b.isIntN(a)&&(a=a.toInt());a%=m;if(0===a)return this;0>a&&(a+=m);var d=a/8|0;a%=8;for(var c=0,f=s.slice(0,e),g;c<e&&!((g=c+d)>=e);++c)f[g]|=this.bytes[c]<<a&255,++g<e&& | ||
| (f[g]|=this.bytes[c]<<a>>>8&255);return new b(f,this.unsigned)};b.prototype.shiftRight=function(a,d){b.isIntN(a)&&(a=a.toInt());a%=m;if(0===a)return this;0>a&&(a+=m);var c=a/8|0;a%=8;var f=s.slice(0,e),g;if(!d&&128===(this.bytes[n]&128)){var l;g=e-1;for(l=e-c-1;g>=l;--g)f[g]=255;f[++g]=f[g]<<7-a&255}var k;for(g=0;g<e;++g)0<=(k=g-c)&&(f[k]|=this.bytes[g]>>>a&255),0<=--k&&(f[k]|=this.bytes[g]<<8>>>a&255);return new b(f,this.unsigned)};b.prototype.shiftRightUnsigned=function(a){return this.shiftRight(a, | ||
| !0)};b.prototype.isSet=function(a){return(this.bytes[a/8|0]&(a=1<<a%8))===a};b.prototype.set=function(a,d){if(a>=m||this.isSet(a)==d)return this;var c=this.bytes.slice();c[a/8|0]=d?c[a/8|0]|1<<a%8:c[a/8|0]&255-(1<<a%8);return new b(c,this.unsigned)};b.prototype.size=function(){for(var a=n,b,c=1;0<=a;--a)if(0!==(b=this.bytes[a])){for(;b>>=1;)c++;return 8*a+c}return 0};b.add=function(a,b){for(var c=a.and(b),f=a.xor(b),g;!c.isZero();)g=c.shiftLeft(1),c=f.and(g),f=f.xor(g);return f};b.prototype.add=function(a){b.isIntN(a)|| | ||
| (a=b.valueOf(a));return b.add(this,a)};b.prototype.negate=function(){return b.add(this.not(),b.ONE)};b.NEG_ONE=b.ONE.negate();b.subtract=function(a,d){return b.add(a,d.negate())};b.prototype.subtract=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.subtract(this,a)};b.prototype.absolute=function(){return this.unsigned?this:(this.isNegative()?this.negate():this).toUnsigned()};b.multiply=function(a,d){for(var c=a.unsigned?b.UZERO:b.ZERO,f=a.absolute(),g=d.absolute();!g.isZero();)1===(g.bytes[0]&1)&& | ||
| (c=b.add(c,f)),f=f.shiftLeft(1),g=g.shiftRight(1,!0);a.unsigned||a.isNegative()!==d.isNegative()&&(c=c.negate());return c};b.prototype.multiply=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.multiply(this,a)};b.divide=function(a,d){if(d.isZero())throw Error("division by zero");a.unsigned&&(d=d.toUnsigned());for(var c=a.absolute(),f=d.absolute(),g=b.UZERO,e=b.UZERO,k=c.size()-1;0<=k;--k)e=e.shiftLeft(1),e=e.set(0,c.isSet(k)),e.greaterThanEqual(f)&&(e=b.add(e,f.negate()),g=g.set(k,!0));a.unsigned|| | ||
| (g=g.toSigned(),e=e.toSigned(),a.isNegative()!==d.isNegative()&&(g=g.negate()),a.isNegative()&&(e=e.negate()));return{quotient:g,remainder:e}};b.prototype.divide=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.divide(this,a).quotient};b.prototype.modulo=function(a){b.isIntN(a)||(a=b.valueOf(a));return b.divide(this,a).remainder};b.prototype.toDebug=function(a){for(var b=n,c,f="";0<=b;--b){for(c=this.bytes[b].toString(2);8>c.length;)c="0"+c;f+=c;a&&0<b&&(f+=" ")}this.unsigned&&(f+=a?" U":"U");return f}; | ||
| var v=b.fromInt(2),w=b.fromInt(36);b.fromString=function(a,d,c){"number"===typeof d&&(c=d,d=!1);a=(a+"").toLowerCase();c=c||10;if(2>c||36<c)throw RangeError("radix out of range: "+c+" (2-36)");if("-"===a.charAt(0))return b.fromString(a.substring(1),d,c).negate();"+"===a.charAt(0)&&(a=a.substring(1));if("0"===a||"NaN"===a||"Infinity"===a)return d?b.UZERO:b.ZERO;d=d?b.UZERO:b.ZERO;for(var f=2===c?function(a){return 1<<a}:Math.pow.bind(Math,c),e=0,l=a.length,k,h;e<l;++e){k=a.charAt(l-e-1);h="0123456789abcdefghijklmnopqrstuvwxyz".indexOf(k); | ||
| if(0>h||h>c)throw Error("illegal interior character: "+k);d=b.add(d,b.multiply(b.fromInt(h),b.fromInt(f(e))))}return d};b.prototype.toString=function(a){a=a||10;b.isIntN(a)||(a=b.valueOf(a));if(a.lessThan(v)||a.greaterThan(w))throw RangeError("radix out of range: "+a.toInt()+" (2-36)");var d=this.unsigned?b.UZERO:b.ZERO;if(this.isNegative()){if(this.equals(b.MIN_VALUE)){var d=b.divide(this,a).quotient,c=b.add(b.multiply(d,a),this.negate());return d.toString(a)+c.toInt().toString(a.toInt())}return"-"+ | ||
| this.negate().toString(a)}var c=this.toUnsigned(),f=[],e;do e=b.divide(c,a),f.unshift("0123456789abcdefghijklmnopqrstuvwxyz".charAt(e.remainder.toInt())),c=b.divide(c,a).quotient;while(!c.equals(d));return f.join("")};b["isInt"+m]=b.isIntN;for(var p in r)if(r.hasOwnProperty(p)){for(h=0;h<r[p].length;++h)b[p]&&(b[r[p][h]]=b[p]);for(h=0;h<r[p].length;++h)b.prototype[p]&&(b.prototype[r[p][h]]=b.prototype[p])}return q[m]=b}}();"undefined"!==typeof module&&module.exports?module.exports=q:"function"=== | ||
| typeof define&&define.amd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EAA1C,MAHW,CAG6CC,CAtiC9C,CAAjB,CAAD,CAwiCG,IAxiCH;", | ||
| "sources":["dist/IntN.js"], | ||
| "names":["global","IntN","makeIntN","nBits","bytes","unsigned","Array","nBytes","i","k","Math","min","length","Error","classes","maxIndex","zeroes","ones","BITS","BYTES","isIntN","IntN.isIntN","obj","isArray","valueOf","IntN.valueOf","val","fromNumber","fromString","low","high","fromInts","prototype","cast","IntN.prototype.cast","TargetIntN","retainMsb","isNegative","not","ZERO","UZERO","ONE","UONE","MIN_VALUE","slice","MAX_VALUE","MAX_UNSIGNED_VALUE","isSigned","IntN.prototype.isSigned","isUnsigned","IntN.prototype.isUnsigned","toSigned","IntN.prototype.toSigned","toUnsigned","IntN.prototype.toUnsigned","IntN.prototype.isNegative","isPositive","IntN.prototype.isPositive","isEven","IntN.prototype.isEven","isOdd","IntN.prototype.isOdd","isZero","IntN.prototype.isZero","compare","IntN.prototype.compare","other","equals","IntN.prototype.equals","notEquals","IntN.prototype.notEquals","lessThan","IntN.prototype.lessThan","lessThanEqual","IntN.prototype.lessThanEqual","greaterThan","IntN.prototype.greaterThan","greaterThanEqual","IntN.prototype.greaterThanEqual","fromInt","IntN.fromInt","value","int32_min_value","negate","toInt","IntN.prototype.toInt","result","IntN.fromInts","ints","ceil","or","shiftLeft","toInts","IntN.prototype.toInts","numInts","arr","offset","j","l","IntN.fromNumber","TypeError","isFinite","floor","toNumber","IntN.prototype.toNumber","double_256_pwr","IntN.prototype.not","and","IntN.prototype.and","IntN.prototype.or","xor","IntN.prototype.xor","IntN.prototype.shiftLeft","numBits","numBytes","idx","shiftRight","IntN.prototype.shiftRight","logical","shiftRightUnsigned","IntN.prototype.shiftRightUnsigned","isSet","IntN.prototype.isSet","set","IntN.prototype.set","add","IntN.add","a","b","carry","carryPwr2","IntN.prototype.add","IntN.prototype.negate","NEG_ONE","subtract","IntN.prototype.subtract","absolute","IntN.prototype.absolute","multiply","IntN.multiply","IntN.prototype.multiply","divide","IntN.divide","dividend","divisor","IntM","divmod","quotient","remainder","product","term","termMsb","IntN.prototype.divide","modulo","IntN.prototype.modulo","toDebug","IntN.prototype.toDebug","spaces","byt","out","toString","IntN_2","IntN_36","IntN.fromString","radix","toLowerCase","RangeError","charAt","substring","radixToPower","pow","bind","ch","chars","indexOf","IntN.prototype.toString","zero","div","rem","digits","unshift","join","key","aliases","hasOwnProperty","module","define"] | ||
| "names":["global","IntN","classes","double_256_pwr","aliases","makeIntN","nBits","bytes","unsigned","Array","nBytes","i","k","Math","min","length","Error","maxIndex","zeroes","ones","BITS","BYTES","isIntN","IntN.isIntN","obj","isArray","valueOf","IntN.valueOf","val","fromNumber","fromString","low","high","fromInts","prototype","cast","IntN.prototype.cast","TargetIntN","retainMsb","isNegative","not","ZERO","UZERO","ONE","UONE","MIN_VALUE","slice","MAX_VALUE","MAX_UNSIGNED_VALUE","isSigned","IntN.prototype.isSigned","isUnsigned","IntN.prototype.isUnsigned","toSigned","IntN.prototype.toSigned","toUnsigned","IntN.prototype.toUnsigned","IntN.prototype.isNegative","isPositive","IntN.prototype.isPositive","isEven","IntN.prototype.isEven","isOdd","IntN.prototype.isOdd","isZero","IntN.prototype.isZero","compare","IntN.prototype.compare","other","equals","IntN.prototype.equals","notEquals","IntN.prototype.notEquals","lessThan","IntN.prototype.lessThan","lessThanEqual","IntN.prototype.lessThanEqual","greaterThan","IntN.prototype.greaterThan","greaterThanEqual","IntN.prototype.greaterThanEqual","fromInt","IntN.fromInt","value","int32_min_value","negate","toInt","IntN.prototype.toInt","result","IntN.fromInts","ints","ceil","or","shiftLeft","toInts","IntN.prototype.toInts","numInts","arr","offset","j","l","IntN.fromNumber","TypeError","isFinite","floor","toNumber","IntN.prototype.toNumber","IntN.prototype.not","and","IntN.prototype.and","IntN.prototype.or","xor","IntN.prototype.xor","IntN.prototype.shiftLeft","numBits","numBytes","idx","shiftRight","IntN.prototype.shiftRight","logical","shiftRightUnsigned","IntN.prototype.shiftRightUnsigned","isSet","IntN.prototype.isSet","set","IntN.prototype.set","size","IntN.prototype.size","byt","add","IntN.add","augend","addend","carry","carryPwr2","IntN.prototype.add","IntN.prototype.negate","NEG_ONE","subtract","IntN.subtract","minuend","subtrahend","IntN.prototype.subtract","absolute","IntN.prototype.absolute","multiply","IntN.multiply","multiplicand","multiplier","m","n","IntN.prototype.multiply","divide","IntN.divide","dividend","divisor","d","q","r","IntN.prototype.divide","modulo","IntN.prototype.modulo","toDebug","IntN.prototype.toDebug","addSpaces","out","toString","IntN_2","IntN_36","IntN.fromString","radix","toLowerCase","RangeError","charAt","substring","radixToPower","pow","bind","ch","chars","indexOf","IntN.prototype.toString","zero","div","rem","digits","divmod","unshift","join","key","hasOwnProperty","module","define"] | ||
| } |
+53
-35
@@ -108,11 +108,11 @@ ## Class IntN | ||
| #### IntN.add(a, b) | ||
| #### IntN.add(augend, addend) | ||
| Adds the specified IntNs and returns the sum. Does not type check arguments. | ||
| Adds the specified IntNs. Does not type check arguments. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | a | *!IntN* | | ||
| | b | *!IntN* | | ||
| | **@returns** | *!IntN* | | ||
| | augend | *!IntN* | Augend | ||
| | addend | *!IntN* | Addend | ||
| | **@returns** | *!IntN* | Sum | ||
@@ -126,5 +126,5 @@ #### IntN.divide(dividend, divisor) | ||
| |-----------------|-----------------|--------------- | ||
| | dividend | *!IntN* | | ||
| | divisor | *!IntN* | | ||
| | **@returns** | *!{quotient: !IntN, remainder: !IntN}* | | ||
| | dividend | *!IntN* | Dividend | ||
| | divisor | *!IntN* | Divisor | ||
| | **@returns** | *!{quotient: !IntN, remainder: !IntN}* | Quotient and remainder | ||
@@ -160,3 +160,3 @@ #### IntN.fromInt(value, unsigned=) | ||
| | value | *number* | Number value | ||
| | unsigned | *boolean* | Whether unsigned or not, defaults `false` for signed | ||
| | unsigned | *boolean* | Whether unsigned or not, defaults to `false` for signed | ||
| | **@returns** | *!IntN* | | ||
@@ -188,3 +188,3 @@ | **@see** | | https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER | ||
| #### IntN.multiply(a, b) | ||
| #### IntN.multiply(multiplicand, multiplier) | ||
@@ -195,6 +195,16 @@ Multiplies the specified IntNs and returns the product. Does not type check arguments. | ||
| |-----------------|-----------------|--------------- | ||
| | a | *!IntN* | | ||
| | b | *!IntN* | | ||
| | **@returns** | *!IntN* | | ||
| | multiplicand | *!IntN* | Multiplicand | ||
| | multiplier | *!IntN* | Multiplier | ||
| | **@returns** | *!IntN* | Product | ||
| #### IntN.subtract(minuend, subtrahend) | ||
| Subtracts the second from the first specified IntN. Does not type check arguments. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | minuend | *!IntN* | Minuend | ||
| | subtrahend | *!IntN* | Subtrahend | ||
| | **@returns** | *!IntN* | Difference | ||
| #### IntN.valueOf(val) | ||
@@ -233,12 +243,12 @@ | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Absolute | ||
| #### IntN#add(other) | ||
| #### IntN#add(addend) | ||
| Adds the specified to this IntN and returns the sum. | ||
| Adds the specified to this IntN. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | addend | *!IntN | number | string* | Addend | ||
| | **@returns** | *!IntN* | Sum | ||
@@ -273,3 +283,3 @@ #### IntN#and(other) | ||
| #### IntN#divide(other) | ||
| #### IntN#divide(divisor) | ||
@@ -280,4 +290,4 @@ Divides this IntN by the specified and returns the quotient. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | divisor | *!IntN | number | string* | Divisor | ||
| | **@returns** | *!IntN* | Quotient | ||
@@ -394,3 +404,3 @@ #### IntN#equals(other) | ||
| #### IntN#modulo(other) | ||
| #### IntN#modulo(divisor) | ||
@@ -401,6 +411,6 @@ Divides this IntN by the specified and returns the remainder. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | divisor | *!IntN | number | string* | Divisor | ||
| | **@returns** | *!IntN* | Remainder | ||
| #### IntN#multiply(other) | ||
| #### IntN#multiply(multiplier) | ||
@@ -411,12 +421,12 @@ Multiplies this IntN with the specified and returns the product. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | multiplier | *!IntN | number | string* | Multiplier | ||
| | **@returns** | *!IntN* | Product | ||
| #### IntN#negate() | ||
| Negates this IntN (*-1) and returns the result. | ||
| Negates this IntN (*-1). | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Negation | ||
@@ -486,6 +496,14 @@ #### IntN#not() | ||
| | numBits | *!IntN | number* | Number of bits | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Shifted | ||
| #### IntN#subtract(other) | ||
| #### IntN#size() | ||
| Returns the number of bits required to fully represent this IntN's value. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *number* | Shift of the most significant bit (0 to N) | ||
| #### IntN#subtract(subtrahend) | ||
| Subtracts the specified from this IntN and returns the difference. | ||
@@ -495,6 +513,6 @@ | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | subtrahend | *!IntN | number | string* | Subtrahend | ||
| | **@returns** | *!IntN* | Difference | ||
| #### IntN#toDebug(spaces=) | ||
| #### IntN#toDebug(addSpaces=) | ||
@@ -506,3 +524,3 @@ Converts this IntN to its full binary representation. This returns N (number of bits) binary digits for | ||
| |-----------------|-----------------|--------------- | ||
| | spaces | *boolean* | Whether to insert spaces between bytes, defaults to `false` | ||
| | addSpaces | *boolean* | Whether to insert spaces between bytes, defaults to `false` | ||
| | **@returns** | *string* | | ||
@@ -509,0 +527,0 @@ |
+1
-1
| { | ||
| "name": "intn", | ||
| "version": "0.12.0", | ||
| "version": "0.13.0", | ||
| "author": "Daniel Wirtz <dcode@dcode.io>", | ||
@@ -5,0 +5,0 @@ "description": "A library for representing and working with arbitrary byte size two's complement integers, signed and unsigned.", |
+53
-36
@@ -134,11 +134,11 @@  | ||
| #### IntN.add(a, b) | ||
| #### IntN.add(augend, addend) | ||
| Adds the specified IntNs and returns the sum. Does not type check arguments. | ||
| Adds the specified IntNs. Does not type check arguments. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | a | *!IntN* | | ||
| | b | *!IntN* | | ||
| | **@returns** | *!IntN* | | ||
| | augend | *!IntN* | Augend | ||
| | addend | *!IntN* | Addend | ||
| | **@returns** | *!IntN* | Sum | ||
@@ -152,5 +152,5 @@ #### IntN.divide(dividend, divisor) | ||
| |-----------------|-----------------|--------------- | ||
| | dividend | *!IntN* | | ||
| | divisor | *!IntN* | | ||
| | **@returns** | *!{quotient: !IntN, remainder: !IntN}* | | ||
| | dividend | *!IntN* | Dividend | ||
| | divisor | *!IntN* | Divisor | ||
| | **@returns** | *!{quotient: !IntN, remainder: !IntN}* | Quotient and remainder | ||
@@ -186,3 +186,3 @@ #### IntN.fromInt(value, unsigned=) | ||
| | value | *number* | Number value | ||
| | unsigned | *boolean* | Whether unsigned or not, defaults `false` for signed | ||
| | unsigned | *boolean* | Whether unsigned or not, defaults to `false` for signed | ||
| | **@returns** | *!IntN* | | ||
@@ -214,3 +214,3 @@ | **@see** | | https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER | ||
| #### IntN.multiply(a, b) | ||
| #### IntN.multiply(multiplicand, multiplier) | ||
@@ -221,6 +221,16 @@ Multiplies the specified IntNs and returns the product. Does not type check arguments. | ||
| |-----------------|-----------------|--------------- | ||
| | a | *!IntN* | | ||
| | b | *!IntN* | | ||
| | **@returns** | *!IntN* | | ||
| | multiplicand | *!IntN* | Multiplicand | ||
| | multiplier | *!IntN* | Multiplier | ||
| | **@returns** | *!IntN* | Product | ||
| #### IntN.subtract(minuend, subtrahend) | ||
| Subtracts the second from the first specified IntN. Does not type check arguments. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | minuend | *!IntN* | Minuend | ||
| | subtrahend | *!IntN* | Subtrahend | ||
| | **@returns** | *!IntN* | Difference | ||
| #### IntN.valueOf(val) | ||
@@ -259,12 +269,12 @@ | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Absolute | ||
| #### IntN#add(other) | ||
| #### IntN#add(addend) | ||
| Adds the specified to this IntN and returns the sum. | ||
| Adds the specified to this IntN. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | addend | *!IntN | number | string* | Addend | ||
| | **@returns** | *!IntN* | Sum | ||
@@ -299,3 +309,3 @@ #### IntN#and(other) | ||
| #### IntN#divide(other) | ||
| #### IntN#divide(divisor) | ||
@@ -306,4 +316,4 @@ Divides this IntN by the specified and returns the quotient. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | divisor | *!IntN | number | string* | Divisor | ||
| | **@returns** | *!IntN* | Quotient | ||
@@ -420,3 +430,3 @@ #### IntN#equals(other) | ||
| #### IntN#modulo(other) | ||
| #### IntN#modulo(divisor) | ||
@@ -427,6 +437,6 @@ Divides this IntN by the specified and returns the remainder. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | divisor | *!IntN | number | string* | Divisor | ||
| | **@returns** | *!IntN* | Remainder | ||
| #### IntN#multiply(other) | ||
| #### IntN#multiply(multiplier) | ||
@@ -437,12 +447,12 @@ Multiplies this IntN with the specified and returns the product. | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | multiplier | *!IntN | number | string* | Multiplier | ||
| | **@returns** | *!IntN* | Product | ||
| #### IntN#negate() | ||
| Negates this IntN (*-1) and returns the result. | ||
| Negates this IntN (*-1). | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Negation | ||
@@ -512,6 +522,14 @@ #### IntN#not() | ||
| | numBits | *!IntN | number* | Number of bits | ||
| | **@returns** | *!IntN* | | ||
| | **@returns** | *!IntN* | Shifted | ||
| #### IntN#subtract(other) | ||
| #### IntN#size() | ||
| Returns the number of bits required to fully represent this IntN's value. | ||
| | Parameter | Type | Description | ||
| |-----------------|-----------------|--------------- | ||
| | **@returns** | *number* | Shift of the most significant bit (0 to N) | ||
| #### IntN#subtract(subtrahend) | ||
| Subtracts the specified from this IntN and returns the difference. | ||
@@ -521,6 +539,6 @@ | ||
| |-----------------|-----------------|--------------- | ||
| | other | *!IntN | number | string* | Other number | ||
| | **@returns** | *!IntN* | | ||
| | subtrahend | *!IntN | number | string* | Subtrahend | ||
| | **@returns** | *!IntN* | Difference | ||
| #### IntN#toDebug(spaces=) | ||
| #### IntN#toDebug(addSpaces=) | ||
@@ -532,3 +550,3 @@ Converts this IntN to its full binary representation. This returns N (number of bits) binary digits for | ||
| |-----------------|-----------------|--------------- | ||
| | spaces | *boolean* | Whether to insert spaces between bytes, defaults to `false` | ||
| | addSpaces | *boolean* | Whether to insert spaces between bytes, defaults to `false` | ||
| | **@returns** | *string* | | ||
@@ -630,3 +648,2 @@ | ||
| * **shiftRightUnsigned**: rshu, rightShiftUnsigned, >>> | ||
| * **isSet**: is | ||
@@ -633,0 +650,0 @@ ##### Arithmetic operations: |
+115
-102
@@ -465,3 +465,3 @@ var IntN = (function() { | ||
| * @param {number} value Number value | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults `false` for signed | ||
| * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed | ||
| * @returns {!IntN} | ||
@@ -607,3 +607,3 @@ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER | ||
| bytes[i] = 0xff; | ||
| bytes[++i /* !k */] = (bytes[i] << (7-numBits)) & 0xff; | ||
| bytes[++i] = (bytes[i] << (7-numBits)) & 0xff; | ||
| } | ||
@@ -623,3 +623,3 @@ var idx; | ||
| * @param {!IntN|number} numBits Number of bits | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Shifted | ||
| * @expose | ||
@@ -650,3 +650,3 @@ */ | ||
| IntN.prototype.set = function(i, isSet) { | ||
| if (this.isSet(i) == isSet) | ||
| if (i >= nBits || this.isSet(i) == isSet) | ||
| return this; | ||
@@ -661,17 +661,30 @@ var bytes = this.bytes.slice(); | ||
| /** | ||
| * Returns the number of bits required to fully represent this IntN's value. | ||
| * @returns {number} Shift of the most significant bit (0 to N) | ||
| * @expose | ||
| */ | ||
| IntN.prototype.size = function() { | ||
| for (var i=maxIndex, byt, j=1; i>=0; --i) | ||
| if ((byt = this.bytes[i]) !== 0) { | ||
| while (byt >>= 1) | ||
| j++; | ||
| return i*8 + j; | ||
| } | ||
| return 0; | ||
| }; | ||
| // Arithmetic operations | ||
| /** | ||
| * Adds the specified IntNs and returns the sum. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * Adds the specified IntNs. Does not type check arguments. | ||
| * @param {!IntN} augend Augend | ||
| * @param {!IntN} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.add = function(a, b) { | ||
| var carry = a.and(b), | ||
| result = a.xor(b), | ||
| IntN.add = function(augend, addend) { | ||
| var carry = augend.and(addend), | ||
| result = augend.xor(addend), | ||
| carryPwr2; | ||
| // There seem to be no performance benefits testing against == 0 or == 1 (test probably too costly in avg). | ||
| // Thus, such optimization should be implemented by the user explicitly where these cases are likely. | ||
| while (!carry.isZero()) | ||
@@ -685,16 +698,16 @@ carryPwr2 = carry.shiftLeft(1), | ||
| /** | ||
| * Adds the specified to this IntN and returns the sum. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * Adds the specified to this IntN. | ||
| * @param {!IntN|number|string} addend Addend | ||
| * @returns {!IntN} Sum | ||
| * @expose | ||
| */ | ||
| IntN.prototype.add = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other); | ||
| IntN.prototype.add = function(addend) { | ||
| if (!IntN.isIntN(addend)) | ||
| addend = IntN.valueOf(addend); | ||
| return IntN.add(this, addend); | ||
| }; | ||
| /** | ||
| * Negates this IntN (*-1) and returns the result. | ||
| * @returns {!IntN} | ||
| * Negates this IntN (*-1). | ||
| * @returns {!IntN} Negation | ||
| * @expose | ||
@@ -715,11 +728,22 @@ */ | ||
| /** | ||
| * Subtracts the second from the first specified IntN. Does not type check arguments. | ||
| * @param {!IntN} minuend Minuend | ||
| * @param {!IntN} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.subtract = function(minuend, subtrahend) { | ||
| return IntN.add(minuend, subtrahend.negate()); | ||
| }; | ||
| /** | ||
| * Subtracts the specified from this IntN and returns the difference. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} subtrahend Subtrahend | ||
| * @returns {!IntN} Difference | ||
| * @expose | ||
| */ | ||
| IntN.prototype.subtract = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.add(this, other.negate()); | ||
| IntN.prototype.subtract = function(subtrahend) { | ||
| if (!IntN.isIntN(subtrahend)) | ||
| subtrahend = IntN.valueOf(subtrahend); | ||
| return IntN.subtract(this, subtrahend); | ||
| }; | ||
@@ -729,3 +753,3 @@ | ||
| * Returns this IntN's absolute value as an unsigned IntN. | ||
| * @returns {!IntN} | ||
| * @returns {!IntN} Absolute | ||
| * @expose | ||
@@ -741,17 +765,21 @@ */ | ||
| * Multiplies the specified IntNs and returns the product. Does not type check arguments. | ||
| * @param {!IntN} a | ||
| * @param {!IntN} b | ||
| * @returns {!IntN} | ||
| * @param {!IntN} multiplicand Multiplicand | ||
| * @param {!IntN} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.multiply = function(a, b) { | ||
| // See comment in add above | ||
| var isNegative = a.isNegative() !== b.isNegative(), | ||
| result = a.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| a = a.absolute(); | ||
| b = b.absolute(); | ||
| for(;!b.isZero(); a=a.shiftLeft(1), b=b.shiftRight(1, true)) | ||
| if ((b.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, a); | ||
| return isNegative ? result.negate() : result; | ||
| IntN.multiply = function(multiplicand, multiplier) { | ||
| var result = multiplicand.unsigned ? IntN.UZERO : IntN.ZERO; | ||
| var m = multiplicand.absolute(), | ||
| n = multiplier.absolute(); | ||
| while (!n.isZero()) { | ||
| if ((n.bytes[0] & 1) === 1) | ||
| result = IntN.add(result, m); | ||
| m = m.shiftLeft(1); | ||
| n = n.shiftRight(1, true); | ||
| } | ||
| if (!multiplicand.unsigned) | ||
| if (multiplicand.isNegative() !== multiplier.isNegative()) | ||
| result = result.negate(); | ||
| return result; | ||
| }; | ||
@@ -761,10 +789,10 @@ | ||
| * Multiplies this IntN with the specified and returns the product. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} multiplier Multiplier | ||
| * @returns {!IntN} Product | ||
| * @expose | ||
| */ | ||
| IntN.prototype.multiply = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.multiply(this, other); | ||
| IntN.prototype.multiply = function(multiplier) { | ||
| if (!IntN.isIntN(multiplier)) | ||
| multiplier = IntN.valueOf(multiplier); | ||
| return IntN.multiply(this, multiplier); | ||
| }; | ||
@@ -775,5 +803,5 @@ | ||
| * not type check arguments. | ||
| * @param {!IntN} dividend | ||
| * @param {!IntN} divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} | ||
| * @param {!IntN} dividend Dividend | ||
| * @param {!IntN} divisor Divisor | ||
| * @returns {!{quotient: !IntN, remainder: !IntN}} Quotient and remainder | ||
| * @expose | ||
@@ -786,38 +814,24 @@ */ | ||
| divisor = divisor.toUnsigned(); | ||
| if (dividend.unsigned && dividend.greaterThan(IntN.MAX_VALUE)) { | ||
| // Ensure correct results for large unsigned values. TODO: Is there a better way? | ||
| var IntM = makeIntN(nBits+8), // constructed when requested, then reused | ||
| divmod = IntM.divide(dividend.cast(IntM), divisor.cast(IntM)); | ||
| return { | ||
| "quotient": divmod['quotient'].cast(IntN), | ||
| "remainder": divmod['remainder'].cast(IntN) | ||
| }; | ||
| var n = dividend.absolute(), | ||
| d = divisor.absolute(), | ||
| q = IntN.UZERO, | ||
| r = IntN.UZERO; | ||
| for (var i=n.size()-1; i>=0; --i) { | ||
| r = r.shiftLeft(1); | ||
| r = r.set(0, n.isSet(i)); | ||
| if (r.greaterThanEqual(d)) | ||
| r = IntN.add(r, d.negate()), | ||
| q = q.set(i, true); | ||
| } | ||
| var isNegative = dividend.isNegative() !== divisor.isNegative(), | ||
| quotient = IntN.UZERO, | ||
| remainder = dividend.absolute(), | ||
| product = divisor.absolute(), | ||
| term = IntN.UONE, | ||
| termMsb = 1; | ||
| while (termMsb < nBits && product.lessThan(remainder)) | ||
| product = product.shiftLeft(1), | ||
| ++termMsb; | ||
| term = term.shiftLeft(termMsb-1); | ||
| while (term.greaterThanEqual(IntN.UONE)) { | ||
| if (product.lessThanEqual(remainder)) | ||
| quotient = IntN.add(quotient, term), | ||
| remainder = IntN.add(remainder, product.negate()); | ||
| product = product.shiftRight(1, true); | ||
| term = term.shiftRight(1, true); | ||
| if (!dividend.unsigned) { | ||
| q = q.toSigned(); | ||
| r = r.toSigned(); | ||
| if (dividend.isNegative() !== divisor.isNegative()) | ||
| q = q.negate(); | ||
| if (dividend.isNegative()) | ||
| r = r.negate(); | ||
| } | ||
| if (!dividend.unsigned) | ||
| quotient = quotient.toSigned(), | ||
| remainder = remainder.toSigned(); | ||
| if (isNegative) | ||
| quotient = quotient.negate(); | ||
| if (dividend.isNegative() || (quotient.isNegative() !== divisor.isNegative() && !quotient.isZero())) | ||
| remainder = remainder.negate(); // remainder = dividend - quotient*divisor | ||
| return { | ||
| "quotient": quotient, | ||
| "remainder": remainder | ||
| "quotient": q, | ||
| "remainder": r | ||
| }; | ||
@@ -828,10 +842,10 @@ }; | ||
| * Divides this IntN by the specified and returns the quotient. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Quotient | ||
| * @expose | ||
| */ | ||
| IntN.prototype.divide = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['quotient']; | ||
| IntN.prototype.divide = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['quotient']; | ||
| }; | ||
@@ -841,10 +855,10 @@ | ||
| * Divides this IntN by the specified and returns the remainder. | ||
| * @param {!IntN|number|string} other Other number | ||
| * @returns {!IntN} | ||
| * @param {!IntN|number|string} divisor Divisor | ||
| * @returns {!IntN} Remainder | ||
| * @expose | ||
| */ | ||
| IntN.prototype.modulo = function(other) { | ||
| if (!IntN.isIntN(other)) | ||
| other = IntN.valueOf(other); | ||
| return IntN.divide(this, other)['remainder']; | ||
| IntN.prototype.modulo = function(divisor) { | ||
| if (!IntN.isIntN(divisor)) | ||
| divisor = IntN.valueOf(divisor); | ||
| return IntN.divide(this, divisor)['remainder']; | ||
| }; | ||
@@ -855,7 +869,7 @@ | ||
| * testing and debugging, followed by the character `U` if unsigned. | ||
| * @param {boolean=} spaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @param {boolean=} addSpaces Whether to insert spaces between bytes, defaults to `false` | ||
| * @returns {string} | ||
| * @expose | ||
| */ | ||
| IntN.prototype.toDebug = function(spaces) { | ||
| IntN.prototype.toDebug = function(addSpaces) { | ||
| for (var i=maxIndex, byt, out=""; i>=0; --i) { | ||
@@ -866,7 +880,7 @@ byt = this.bytes[i].toString(2); | ||
| out += byt; | ||
| if (spaces && i > 0) | ||
| if (addSpaces && i > 0) | ||
| out += ' '; | ||
| } | ||
| if (this.unsigned) | ||
| out += spaces ? " U" : 'U'; | ||
| out += addSpaces ? " U" : 'U'; | ||
| return out; | ||
@@ -956,3 +970,3 @@ }; | ||
| // now always gt 0: | ||
| var result = this, | ||
| var result = this.toUnsigned(), | ||
| digits = [], | ||
@@ -1046,3 +1060,2 @@ divmod; | ||
| 'shiftRightUnsigned': ['rshu', 'rightShiftUnsigned', '>>>'], | ||
| 'isSet': ['is'], | ||
| // Arithmetic operations | ||
@@ -1049,0 +1062,0 @@ 'add': ['plus', '+'], |
+12
-2
@@ -44,3 +44,3 @@ var IntN = require("../dist/IntN.min.js"), | ||
| for (var i=0; i<1000; ++i) | ||
| for (var i=0; i<500; ++i) | ||
| defaultCases.push([(Math.random()*0xffffffff)|0, (Math.random()*0xffffffff)|0]), | ||
@@ -582,5 +582,6 @@ defaultCases.push([(Math.random()*0xffffffff)>>>0, (Math.random()*0xffffffff)>>>0, true]); | ||
| "isSet": function(test) { | ||
| test.strictEqual(Int32.prototype.is, Int32.prototype.isSet); | ||
| test.strictEqual(Int32.ONE.isSet(0), true); | ||
| test.strictEqual(Int32.ONE.isSet(1), false); | ||
| test.strictEqual(Int32.NEG_ONE.isSet(31), true); | ||
| test.strictEqual(Int32.NEG_ONE.isSet(32), false); // oob | ||
| var val = Int32.ONE.shiftLeft(9); | ||
@@ -596,2 +597,3 @@ for (var i=0; i<Int32.BITS; ++i) | ||
| test.strictEqual(Int32.ONE.set(0, false).toInt(), 0); | ||
| test.strictEqual(Int32.ZERO.set(32, true), Int32.ZERO); // oob | ||
| for (var i= 0, val; i<Int32.BITS; ++i) { | ||
@@ -603,2 +605,10 @@ test.strictEqual((val=Int32.ZERO.set(i, true)).toInt(), 1<<i); | ||
| test.done(); | ||
| }, | ||
| "size": function(test) { | ||
| test.strictEqual(Int32.ZERO.size(), 0); | ||
| test.strictEqual(Int32.ONE.size(), 1); | ||
| test.strictEqual(Int32.MAX_VALUE.size(), 31); | ||
| test.strictEqual(Int32.MIN_VALUE.size(), 32); | ||
| test.done(); | ||
| } | ||
@@ -605,0 +615,0 @@ }, |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
251803
0.73%3738
1.19%661
2.64%17
142.86%