blob: 9fc7e7e90a4d58a14cb1b35cc65c64499c7ec787 [file] [log] [blame]
Austin Schuh7c75e582020-11-14 16:41:18 -08001"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Long = exports.createLong = void 0;
4function createLong(low, high) {
5 return Long.create(low, high);
6}
7exports.createLong = createLong;
8var Long = /** @class */ (function () {
9 function Long(low, high) {
10 this.low = low | 0;
11 this.high = high | 0;
12 }
13 Long.create = function (low, high) {
14 // Special-case zero to avoid GC overhead for default values
15 return low == 0 && high == 0 ? Long.ZERO : new Long(low, high);
16 };
17 Long.prototype.toFloat64 = function () {
18 return (this.low >>> 0) + this.high * 0x100000000;
19 };
20 Long.prototype.equals = function (other) {
21 return this.low == other.low && this.high == other.high;
22 };
23 Long.ZERO = new Long(0, 0);
24 return Long;
25}());
26exports.Long = Long;