And use it to define negate and add for Complex numbers in a way that is independent of component types. Also add a bigint type and verify that pocomath will then handle Gaussian integers "for free".
13 lines
372 B
JavaScript
13 lines
372 B
JavaScript
/* Core of pocomath: generates the default instance */
|
|
import PocomathInstance from './PocomathInstance.mjs'
|
|
import * as numbers from './number/all.mjs'
|
|
import * as bigints from './bigint/all.mjs'
|
|
import * as complex from './complex/all.mjs'
|
|
|
|
const math = new PocomathInstance('math')
|
|
math.install(numbers)
|
|
math.install(bigints)
|
|
math.install(complex)
|
|
|
|
export default math
|