@thi.ng/binary
Advanced tools
Comparing version 3.1.3 to 3.2.0
# Change Log | ||
- **Last updated**: 2021-12-13T10:26:00Z | ||
- **Last updated**: 2022-03-11T12:13:49Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,8 @@ | ||
## [3.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/binary@3.2.0) (2022-03-11) | ||
#### 🚀 Features | ||
- add shiftRL() ([804565e](https://github.com/thi-ng/umbrella/commit/804565e)) | ||
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/binary@3.1.0) (2021-11-17) | ||
@@ -14,0 +20,0 @@ |
@@ -14,3 +14,3 @@ import type { FnN, FnN2 } from "@thi.ng/api"; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -22,3 +22,3 @@ export declare const floatToIntBits64: (x: number) => [number, number]; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -29,4 +29,4 @@ export declare const floatToUintBits64: (x: number) => [number, number]; | ||
* | ||
* @param hi | ||
* @param lo | ||
* @param hi - | ||
* @param lo - | ||
*/ | ||
@@ -37,4 +37,4 @@ export declare const intBitsToFloat64: FnN2; | ||
* | ||
* @param hi | ||
* @param lo | ||
* @param hi - | ||
* @param lo - | ||
*/ | ||
@@ -55,3 +55,3 @@ export declare const uintBitsToFloat64: FnN2; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -62,3 +62,3 @@ export declare const f32u8: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -69,3 +69,3 @@ export declare const f32u16: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -76,3 +76,3 @@ export declare const f32u24: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -83,3 +83,3 @@ export declare const f32u32: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -90,3 +90,3 @@ export declare const u8f32: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -97,3 +97,3 @@ export declare const u16f32: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -104,5 +104,5 @@ export declare const u24f32: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export declare const u32f32: FnN; | ||
//# sourceMappingURL=float.d.ts.map |
28
float.js
@@ -17,3 +17,3 @@ const F64 = new Float64Array(1); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -25,3 +25,3 @@ export const floatToIntBits64 = (x) => ((F64[0] = x), IS_LE ? [I32[1], I32[0]] : [I32[0], I32[1]]); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -32,4 +32,4 @@ export const floatToUintBits64 = (x) => ((F64[0] = x), IS_LE ? [U32[1], U32[0]] : [U32[0], U32[1]]); | ||
* | ||
* @param hi | ||
* @param lo | ||
* @param hi - | ||
* @param lo - | ||
*/ | ||
@@ -43,4 +43,4 @@ export const intBitsToFloat64 = (hi, lo) => { | ||
* | ||
* @param hi | ||
* @param lo | ||
* @param hi - | ||
* @param lo - | ||
*/ | ||
@@ -70,3 +70,3 @@ export const uintBitsToFloat64 = (hi, lo) => { | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -77,3 +77,3 @@ export const f32u8 = (x) => (clamp11(x) * 0x7f) & 0xff; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -84,3 +84,3 @@ export const f32u16 = (x) => (clamp11(x) * 0x7fff) & 0xffff; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -91,3 +91,3 @@ export const f32u24 = (x) => (clamp11(x) * 0x7fffff) & 0xffffff; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -98,3 +98,3 @@ export const f32u32 = (x) => (clamp11(x) * 0x7fffffff) >>> 0; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -105,3 +105,3 @@ export const u8f32 = (x) => ((x &= 0xff), (x | ((x >> 7) * 0xffffff00)) / 0x7f); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -112,3 +112,3 @@ export const u16f32 = (x) => ((x &= 0xffff), (x | ((x >> 15) * 0xffff0000)) / 0x7fff); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -119,4 +119,4 @@ export const u24f32 = (x) => ((x &= 0xffffff), (x | ((x >> 23) * 0xff000000)) / 0x7fffff); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export const u32f32 = (x) => (x | 0) / 0x7fffffff; |
@@ -8,3 +8,3 @@ import type { Range0_31 } from "@thi.ng/api"; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -18,5 +18,5 @@ export declare const binaryOneHot: (x: Range0_31) => number; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export declare const oneHotBinary: (x: number) => number; | ||
//# sourceMappingURL=one-hot.d.ts.map |
@@ -8,3 +8,3 @@ import { clz32 } from "./count.js"; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -18,4 +18,4 @@ export const binaryOneHot = (x) => (1 << x) >>> 0; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export const oneHotBinary = (x) => 31 - clz32(x); |
{ | ||
"name": "@thi.ng/binary", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"description": "100+ assorted binary / bitwise operations, conversions, utilities, lookup tables", | ||
@@ -37,11 +37,11 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.3.3" | ||
"@thi.ng/api": "^8.3.4" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.19.2", | ||
"@thi.ng/testament": "^0.2.3", | ||
"@microsoft/api-extractor": "^7.19.4", | ||
"@thi.ng/testament": "^0.2.4", | ||
"rimraf": "^3.0.2", | ||
"tools": "^0.0.1", | ||
"typedoc": "^0.22.10", | ||
"typescript": "^4.5.3" | ||
"typedoc": "^0.22.13", | ||
"typescript": "^4.6.2" | ||
}, | ||
@@ -133,3 +133,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "2db9dd34c0c2c60cbfde3dad0bca352b20292f5c\n" | ||
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n" | ||
} |
@@ -59,3 +59,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
Package sizes (gzipped, pre-treeshake): ESM: 2.17 KB | ||
Package sizes (gzipped, pre-treeshake): ESM: 2.19 KB | ||
@@ -101,2 +101,2 @@ ## Dependencies | ||
© 2016 - 2021 Karsten Schmidt // Apache Software License 2.0 | ||
© 2016 - 2022 Karsten Schmidt // Apache Software License 2.0 |
@@ -16,2 +16,10 @@ import type { Bit } from "./api.js"; | ||
export declare const rotateRight: (x: number, n: Bit) => number; | ||
/** | ||
* Shifts `x` by `n` bits left or right. If `n` >= 0, the value will be `>>>` | ||
* shifted to right, if `n` < 0 the value will be shifted left. | ||
* | ||
* @param x - | ||
* @param n - | ||
*/ | ||
export declare const shiftRL: (x: number, n: number) => number; | ||
//# sourceMappingURL=rotate.d.ts.map |
@@ -15,1 +15,9 @@ /** | ||
export const rotateRight = (x, n) => ((x >>> n) | (x << (32 - n))) >>> 0; | ||
/** | ||
* Shifts `x` by `n` bits left or right. If `n` >= 0, the value will be `>>>` | ||
* shifted to right, if `n` < 0 the value will be shifted left. | ||
* | ||
* @param x - | ||
* @param n - | ||
*/ | ||
export const shiftRL = (x, n) => (n < 0 ? x << -n : x >>> n); |
@@ -47,3 +47,3 @@ import type { FnN } from "@thi.ng/api"; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -54,5 +54,5 @@ export declare const interleave4_12_24: (x: number) => number; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export declare const interleave4_16_32: (x: number) => number; | ||
//# sourceMappingURL=splat.d.ts.map |
@@ -46,3 +46,3 @@ /** | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -53,3 +53,3 @@ export const interleave4_12_24 = (x) => ((x & 0xf00) * 0x1100) | ((x & 0xf0) * 0x110) | ((x & 0xf) * 0x11); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -56,0 +56,0 @@ export const interleave4_16_32 = (x) => (((x & 0xf000) * 0x11000) | |
@@ -119,5 +119,5 @@ import type { FnN, FnN3 } from "@thi.ng/api"; | ||
* | ||
* @param a | ||
* @param b | ||
* @param mask | ||
* @param a - | ||
* @param b - | ||
* @param mask - | ||
*/ | ||
@@ -140,3 +140,3 @@ export declare const mux: FnN3; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -151,3 +151,3 @@ export declare const flip16: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -158,5 +158,5 @@ export declare const swapLane02: FnN; | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export declare const swapLane13: FnN; | ||
//# sourceMappingURL=swizzle.d.ts.map |
@@ -138,5 +138,5 @@ /** | ||
* | ||
* @param a | ||
* @param b | ||
* @param mask | ||
* @param a - | ||
* @param b - | ||
* @param mask - | ||
*/ | ||
@@ -159,3 +159,3 @@ export const mux = (a, b, mask) => (~mask & a) | (mask & b); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -170,3 +170,3 @@ export const flip16 = (x) => mux(x << 16, x >>> 16, 0xffff); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
@@ -177,4 +177,4 @@ export const swapLane02 = (x) => ((x & 0xff00) << 16) | ((x >>> 16) & 0xff00) | (x & 0x00ff00ff); | ||
* | ||
* @param x | ||
* @param x - | ||
*/ | ||
export const swapLane13 = (x) => ((x & 0xff) << 16) | ((x >> 16) & 0xff) | (x & 0xff00ff00); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56361
1172
Updated@thi.ng/api@^8.3.4