Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour authored Oct 1, 2021
1 parent 2f3cf64 commit 4594bf9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ so if we encounter a 0 in the array, we can stop searching for the minimum value
# usage
# getting minimum value of a normal array
```javascript
const min = require("fast-min");
import fastMin from 'fast-min';

const result = min([0, -1, -2, -3, -4, -5]);
const result = fastMin([0, -1, -2, -3, -4, -5]);
// result is -5
```

# getting minimum value of a typed array
```javascript
const min = require("fast-min");
import fastMin from 'fast-min';

const pixel_values = Uint8Array.from([0, 128, 255, 34, ...]);
const result = min(pixel_values);
const result = fastMin(pixel_values);
// result is 0
```

# no data value
If you want to ignore a specific value, you can set the no_data value.
```javascript
const min = require("fast-min");
import fastMin from 'fast-min';

const numbers = [99, 0, 7, 99, 5, ...]);
const result = max(numbers, { no_data: 0 });
const result = fastMin(numbers, { no_data: 0 });
// result is 5
```

Expand Down

0 comments on commit 4594bf9

Please sign in to comment.