feat: Template operations (#41)

Relational functions are added using templates, and existing generic functions are made more strict with them. Also a new built-in typeOf function is added, that automatically updates itself.

Resolves #34.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #41
This commit is contained in:
Glen Whitney 2022-08-01 10:09:32 +00:00
parent 2609310b8e
commit fe54bc6004
29 changed files with 480 additions and 119 deletions

View file

@ -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)))
})
})