x/long@v1.0.0

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.
GitHub Stars
0
Latest
import * as long from "https://deno.land/x/long@v1.0.0/mod.ts";

Classes

default

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.

long

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.

usage

import { assert, assertEquals } from "https://deno.land/std@0.139.0/testing/asserts.ts";
import Long from "https://deno.land/x/long@v1.0.0/mod.ts";

Deno.test("long", function() {
  const value = new Long(0xFFFFFFFF, 0x7FFFFFFF);
  assertEquals(value.toString(), "9223372036854775807");
});

Deno.test("isLong", function() {
  const value = new Long(0xFFFFFFFF, 0x7FFFFFFF);
  assert(Long.isLong(value));
});