source: trip-planner-front/node_modules/hdr-histogram-js/assembly/__tests__/bitcount.spec.ts@ 6a80231

Last change on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 537 bytes
Line 
1/*
2 * This is a AssemblyScript port of the original Java version, which was written by
3 * Gil Tene as described in
4 * https://github.com/HdrHistogram/HdrHistogram
5 * and released to the public domain, as explained at
6 * http://creativecommons.org/publicdomain/zero/1.0/
7 */
8
9import { bitCount } from "../packedarray/bitcount";
10
11describe("bit count", () => {
12 it("should count bits", () => {
13 expect<u8>(bitCount(8)).toBe(1);
14 expect<u8>(bitCount(40)).toBe(2);
15 expect<u8>(bitCount((u64.MAX_VALUE >> 1) + 1)).toBe(1);
16 });
17});
Note: See TracBrowser for help on using the repository browser.