UNPKG

@thi.ng/binary

Version:

100+ assorted binary / bitwise operations, conversions, utilities, lookup tables

8 lines (7 loc) 164 B
import { clz32 } from "./count.js"; const binaryOneHot = (x) => 1 << x >>> 0; const oneHotBinary = (x) => 31 - clz32(x); export { binaryOneHot, oneHotBinary };