All checks were successful
/ test (push) Successful in 17s
Establishes a global config object for a TypeDispatcher instance, so far with just properties representing comparison tolerances. Begins a "relational" group of functions with basic approximate equality, and an initial primitive ordering comparison. Ensures that methods that depend on properties of `config` will be properly updated when those properties change. Reviewed-on: #19 Co-authored-by: Glen Whitney <glen@studioinfinity.org> Co-committed-by: Glen Whitney <glen@studioinfinity.org>
13 lines
332 B
JavaScript
13 lines
332 B
JavaScript
import assert from 'assert'
|
|
import math from '#nanomath'
|
|
|
|
describe('generic utility functions', () => {
|
|
it('tests whether an element is zero', () => {
|
|
const {isZero} = math
|
|
assert(!isZero(3))
|
|
assert(isZero(3e-16))
|
|
assert(isZero(false))
|
|
assert(!isZero(true))
|
|
assert(isZero(undefined))
|
|
})
|
|
})
|