feat: Template types (#45)

Includes a full implementation of a type-homogeneous Tuple type, using the template types
  feature, as a demonstration/check of its operation.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #45
This commit is contained in:
Glen Whitney 2022-08-05 12:48:57 +00:00
parent fd32ee1f10
commit 845a2354c9
28 changed files with 920 additions and 129 deletions

View file

@ -103,4 +103,13 @@ describe('The default full pocomath instance "math"', () => {
assert.strictEqual(math.choose(21n, 2n), 210n)
})
it('calculates multi-way gcds and lcms', () => {
assert.strictEqual(math.gcd(30,105,42), 3)
assert.ok(
math.associate(
math.lcm(
math.complex(2n,1n), math.complex(1n,1n), math.complex(0n,1n)),
math.complex(1n,3n)))
})
})