Integer Array Ops
Preform computations on arrays of integers.
Installation
npm install --save integer-array-ops
Usage
const ops = const lhs = 4 8 16const rhs = 1 8 31 ops // [5, 16, 47]ops // [3, 0, -15] ops // [4, 8, 31]ops // [1, 8, 16] ops // [0, 8, 16]ops // [5, 8, 31]ops // [5, 0, 15]
API
Each function takes two arrays of the same type and of the same length. They return a new array of the same type as the input, with the resulting values.
Name | Operation |
---|---|
add |
+ |
sub |
- |
max |
Math.max |
min |
Math.min |
and |
& |
or |
| |
xor |
^ |