feat(install): Allow plain functions

This commit is contained in:
Glen Whitney 2022-08-02 00:47:37 -07:00
parent 0ce4de086c
commit 8418817f9f
8 changed files with 60 additions and 7 deletions

View file

@ -93,4 +93,14 @@ describe('The default full pocomath instance "math"', () => {
assert.throws(() => math.chain(3).foo(), /Unknown operation/)
})
it('calls plain factorial function', () => {
assert.strictEqual(math.factorial(4), 24n)
assert.strictEqual(math.factorial(7n), 5040n)
})
it('calculates binomial coefficients', () => {
assert.strictEqual(math.choose(6, 3), 20)
assert.strictEqual(math.choose(21n, 2n), 210n)
})
})