npm.io
1.0.2 • Published 2 years ago

@types/popcnt32

Licence
MIT
Version
1.0.2
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/popcnt32

Summary

This package contains type definitions for popcnt32 (https://github.com/emilbayes/popcnt32#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/popcnt32.

index.d.ts

export = popcnt32;

/**
 * Calculate population count (popcnt) on a 32-bit number, branch free.
 *
 * @return Number of 1-bits in `int`. Int is implicitly cast to a 32-bit unsigned int.
 * This means `popcnt32(-1) === 32` while `popcnt32(1) === 1`.
 *
 * @example
 * import popcnt32 = require('popcnt32')
 *
 * popcnt32(0b1) // 1
 * popcnt32(0b1000001) // 2
 */
declare function popcnt32(int: number): number;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.