import { Long } from "https://deno.land/x/web_bson@v0.2.5/src/long.ts";
A class representing a 64-bit integer
Constructors
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.
Acceptable signatures are:
- Long(low, high, unsigned?)
- Long(bigint, unsigned?)
- Long(string, unsigned?)
Methods
Returns the sum of this and the specified Long.
Returns the sum of this and the specified Long.
Compares this Long's value with the specified's.
Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned.
Tests if this Long's value equals the specified's.
This is an alias of Long.isZero
Gets the high 32 bits as a signed integer.
Gets the high 32 bits as an unsigned integer.
Gets the low 32 bits as a signed integer.
Gets the low 32 bits as an unsigned integer.
Gets the number of bits needed to represent the absolute value of this Long.
Tests if this Long's value is greater than the specified's.
Tests if this Long's value is greater than or equal the specified's.
This is an alias of Long.greaterThanOrEqual
Tests if this Long's value is even.
Tests if this Long's value is negative.
Tests if this Long's value is odd.
Tests if this Long's value is positive.
Tests if this Long's value equals zero.
Tests if this Long's value is less than the specified's.
Tests if this Long's value is less than or equal the specified's.
Returns the product of this and the specified Long.
Tests if this Long's value differs from the specified's.
Returns this Long with bits shifted to the left by the given amount.
Returns this Long with bits arithmetically shifted to the right by the given amount.
Returns this Long with bits logically shifted to the right by the given amount.
Returns the difference of this and the specified Long.
Converts the Long to a BigInt (arbitrary precision).
Converts this Long to its byte representation.
Converts this Long to its big endian byte representation.
Converts this Long to its little endian byte representation.
Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
Converts the Long to a string written in the specified radix.
Converts this Long to unsigned.
Static Methods
Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits.
Creates a Long from its byte representation.
Creates a Long from its big endian byte representation.
Creates a Long from its little endian byte representation.
Returns a Long representing the given 32 bit integer value.
Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
Returns a Long representation of the given string, written using the specified radix.