refactor: Make generics more strict via templates
This commit also adds a built-in `typeOf` function to every PocomathInstance. It also adds a notation (prefix '!') for "eager" templeates that instantiate themselves for all types immediately upon definition.
This commit is contained in:
parent
fd3d6b2eb3
commit
36e7b750ce
23 changed files with 233 additions and 44 deletions
|
@ -30,4 +30,11 @@ describe('number', () => {
|
|||
it('computes gcd', () => {
|
||||
assert.strictEqual(math.gcd(15, 35), 5)
|
||||
})
|
||||
|
||||
it('compares numbers', () => {
|
||||
assert.ok(math.smaller(12,13.5))
|
||||
assert.ok(math.equal(Infinity, Infinity))
|
||||
assert.ok(math.largerEq(12.5, math.divide(25,2)))
|
||||
})
|
||||
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue