glam/node_modules/.pnpm/ml-array-rescale@1.3.7/node_modules/ml-array-rescale
2025-12-21 00:01:54 +01:00
..
lib remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
lib-es6 remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
src remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
LICENSE remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
package.json remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
README.md remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00
types.d.ts remove a,bihguous web-claims 2025-12-21 00:01:54 +01:00

array-rescale

NPM version npm download

Rescale an array into a range.

Installation

$ npm install --save ml-array-rescale

Usage

rescale(input[, options])

Rescales the values in the input so they fit between two new values.

Options:

  • min: the new minimum value (default: 0)
  • max: the new maximum value (default: 1)
  • output: an array to use for output. You can pass input here to get an in-place modification.
import rescale from 'ml-array-rescale';

const result = rescale([0, 1, 2, 3, 4]);
// [0, 0.25, 0.5, 0.75, 1]

License

MIT