Skip to main content

subtractSparseRange

Remove one weighted range from another and normalize the remaining mass.

subtractSparseRange(base: SparseRangeSpec | Float64Array, remove: SparseRangeSpec | Float64Array): Float64Array

See Packed card input and SparseRangeSpec where those inputs apply.

Import

const poker = require('poker-calculations');

ESM (Node):

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');

When to use

Use subtractSparseRange when you need to remove one weighted range from another and normalize the remaining mass.

How to use

const poker = require('poker-calculations');
const range = new Float64Array(1326);
range.fill(1 / 1326);

const result = poker.subtractSparseRange(range, 5);
console.log(result);

See also

materializeVillainRangeAfterBlockers · Sparse range input