14 lines
332 B
JavaScript
14 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))
|
||
|
})
|
||
|
})
|