Open charredgrass opened 3 years ago
in statmath.js, binomcoeff fails if n is too large to take a factorial of, even if the expected result would fit into a js Number.
statmath.js
binomcoeff
Number
Example: binomcoeff(2048, 2) should return 2096128 but returns NaN because of the factorials.
binomcoeff(2048, 2)
2096128
NaN
possible solution is to use bigint or use a different way to calculate binomcoeff
in
statmath.js
,binomcoeff
fails if n is too large to take a factorial of, even if the expected result would fit into a jsNumber
.Example:
binomcoeff(2048, 2)
should return2096128
but returnsNaN
because of the factorials.possible solution is to use bigint or use a different way to calculate binomcoeff