Skip to main content

mergeSparseRanges

Blend two ranges with caller-supplied weights and normalize the result.

mergeSparseRanges(a: SparseRangeSpec | Float64Array, b: SparseRangeSpec | Float64Array, weightA: number, weightB: number): 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 mergeSparseRanges when you need to blend two ranges with caller-supplied weights and normalize the result.

How to use

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

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

See also

materializeVillainRangeAfterBlockers · Sparse range input