Skip to main content
Module

x/long/mod.ts>default

A Long class for representing a 64 bit two's-complement integer value derived from the Closure Library for stand-alone use and extended with unsigned support.
Latest
class default
import { default } from "https://deno.land/x/long@v1.0.0/mod.ts";

Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs.

Constructors

new
default(
low: number,
high: number,
unsigned?: boolean,
)

Properties

high: number
low: number
unsigned: boolean

Methods

add(addend0: Long | number | string): Long
and(other0: Long | number | string)
clz()
comp(other: Long | number | string)
compare(other0: Long | number | string)
ctz()
div(divisor0: Long | number | string)
divide(divisor0: Long | number | string): Long
eq(other: Long | number | string): boolean
equals(other: Long | number | string): boolean
eqz()
ge(other: Long | number | string)
getNumBitsAbs(): number
greaterThan(other: Long | number | string)
greaterThanOrEqual(other: Long | number | string)
gt(other: Long | number | string)
gte(other: Long | number | string)
le(other: Long | number | string)
lessThan(other: Long | number | string)
lessThanOrEqual(other: Long | number | string)
lt(other: Long | number | string)
lte(other: Long | number | string)
mod(divisor0: Long | number | string)
modulo(divisor0: Long | number | string)
mul(multiplier: Long | number | string): Long
multiply(multiplier0: Long | number | string)
ne(other: Long | number | string): boolean
neg()
neq(other: Long | number | string): boolean
not()
notEquals(other: Long | number | string): boolean
or(other0: Long | number | string)
rem(divisor0: Long | number | string)
rotateLeft(numBits0: Long | number)
rotateRight(numBits0: Long | number)
rotl(numBits0: Long | number)
rotr(numBits0: Long | number)
shiftLeft(numBits0: Long | number)
shiftRight(numBits0: Long | number)
shiftRightUnsigned(numBits0: Long | number)
shl(numBits0: Long | number)
shr(numBits0: Long | number)
shr_u(numBits0: Long | number)
shru(numBits0: Long | number)
sub(subtrahend: Long | number | string): Long
subtract(subtrahend: Long | number | string): Long
toBytes(le: boolean)
toInt(): number
toString(radix?: number): string
xor(other0: Long | number | string)

Static Properties

INT_CACHE: { [key: number]: Long; }

A cache of the Long representations of small integer values.

MAX_UNSIGNED_VALUE: Long
MAX_VALUE: Long
MIN_VALUE: Long
NEG_ONE: Long
ONE: Long
TWO_PWR_16_DBL
TWO_PWR_24
TWO_PWR_24_DBL
TWO_PWR_32_DBL
TWO_PWR_63_DBL
TWO_PWR_64_DBL
UINT_CACHE: { [key: number]: Long; }

A cache of the Long representations of small unsigned integer values.

UONE: Long
UZERO: Long
ZERO: Long

Static Methods

fromBits(
lowBits: number,
highBits: number,
unsigned?,
): Long
fromBytes(
bytes: number[],
unsigned?,
le?,
)
fromBytesBE(bytes: number[], unsigned?)
fromBytesLE(bytes: number[], unsigned?)
fromInt(value: number, unsigned?): Long
fromNumber(value: number, unsigned?): Long
fromString(
str: string,
unsigned: boolean | number,
radix?: number,
): Long
fromValue(val:
| Long
| number
| string
| { low: number; high: number; unsigned: boolean; }
, unsigned?
): Long
isLong(obj: any): boolean