1 | {"version":3,"file":"number-466d8922.cjs","sources":["../number.js"],"sourcesContent":["/**\n * Utility helpers for working with numbers.\n *\n * @module number\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\n\nexport const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER\nexport const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER\n\nexport const LOWEST_INT32 = 1 << 31\nexport const HIGHEST_INT32 = binary.BITS31\nexport const HIGHEST_UINT32 = binary.BITS32\n\n/* c8 ignore next */\nexport const isInteger = Number.isInteger || (num => typeof num === 'number' && isFinite(num) && math.floor(num) === num)\nexport const isNaN = Number.isNaN\nexport const parseInt = Number.parseInt\n\n/**\n * Count the number of \"1\" bits in an unsigned 32bit number.\n *\n * Super fun bitcount algorithm by Brian Kernighan.\n *\n * @param {number} n\n */\nexport const countBits = n => {\n n &= binary.BITS32\n let count = 0\n while (n) {\n n &= (n - 1)\n count++\n }\n return count\n}\n"],"names":["binary.BITS31","binary.BITS32","math.floor"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;AACY,MAAC,gBAAgB,GAAG,MAAM,CAAC,iBAAgB;AAC3C,MAAC,gBAAgB,GAAG,MAAM,CAAC,iBAAgB;AACvD;AACY,MAAC,YAAY,GAAG,CAAC,IAAI,GAAE;AACvB,MAAC,aAAa,GAAGA,cAAa;AAC9B,MAAC,cAAc,GAAGC,cAAa;AAC3C;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAIC,UAAU,CAAC,GAAG,CAAC,KAAK,GAAG,EAAC;AAC7G,MAAC,KAAK,GAAG,MAAM,CAAC,MAAK;AACrB,MAAC,QAAQ,GAAG,MAAM,CAAC,SAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,CAAC,IAAI;AAC9B,EAAE,CAAC,IAAID,cAAa;AACpB,EAAE,IAAI,KAAK,GAAG,EAAC;AACf,EAAE,OAAO,CAAC,EAAE;AACZ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAC;AAChB,IAAI,KAAK,GAAE;AACX,GAAG;AACH,EAAE,OAAO,KAAK;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;"} |