Skip to content

Commit

Permalink
Expose isEven
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Oct 23, 2014
1 parent f71f9fc commit da00464
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 60 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "long",
"version": "2.2.2",
"version": "2.2.3",
"author": "Daniel Wirtz <[email protected]>",
"description": "A Long class for representing a 64 bit two's-complement integer value.",
"main": "dist/Long.js",
Expand Down
36 changes: 16 additions & 20 deletions dist/Long.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,51 +235,45 @@

/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_16_DBL = 1 << 16;

/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_24_DBL = 1 << 24;

/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;

/**
* @type {number}
* @inner
*/
var TWO_PWR_31_DBL = TWO_PWR_32_DBL / 2;

/**
* @type {number}
* @inner
*/
var TWO_PWR_48_DBL = TWO_PWR_32_DBL * TWO_PWR_16_DBL;

/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;

/**
* @type {number}
* @const
* @inner
*/
var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;

/**
* @type {!Long}
* @const
* @inner
*/
var TWO_PWR_24 = Long.fromInt(1 << 24);
var TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL);

/**
* Signed zero.
Expand Down Expand Up @@ -495,6 +489,7 @@
/**
* Tests if this Long's value is even.
* @returns {boolean}
* @expose
*/
Long.prototype.isEven = function() {
return (this.low & 1) === 0;
Expand Down Expand Up @@ -580,13 +575,14 @@
* @expose
*/
Long.prototype.compare = function(other) {
if (this.equals(other)) {
if (this.equals(other))
return 0;
}
var thisNeg = this.isNegative();
var otherNeg = other.isNegative();
if (thisNeg && !otherNeg) return -1;
if (!thisNeg && otherNeg) return 1;
var thisNeg = this.isNegative(),
otherNeg = other.isNegative();
if (thisNeg && !otherNeg)
return -1;
if (!thisNeg && otherNeg)
return 1;
// At this point the sign bits are the same
if (!this.unsigned)
return this.subtract(other).isNegative() ? -1 : 1;
Expand Down Expand Up @@ -936,7 +932,7 @@
return new Long(this.low, this.high, true);
};

/* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && module.id && typeof exports === 'object' && exports)
/* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && typeof exports === 'object' && exports)
module["exports"] = Long;
/* AMD */ else if (typeof define === 'function' && define["amd"])
define(function() { return Long; });
Expand Down
31 changes: 16 additions & 15 deletions dist/Long.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/Long.min.js.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions dist/Long.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "long",
"version": "2.2.2",
"version": "2.2.3",
"author": "Daniel Wirtz <[email protected]>",
"description": "A Long class for representing a 64-bit two's-complement integer value.",
"main": "index.js",
Expand Down
Loading

0 comments on commit da00464

Please sign in to comment.