picomath/complex/negate.js
Glen Whitney 32bc9ca515 feat: Add complex numbers
With just the operations we have for numbers, and overall tests.
2022-03-25 01:54:20 -07:00

7 lines
199 B
JavaScript

import { isComplex } from './complex.js'
export default function create(pmath) {
return pmath('negate', [args => args.length == 1 && isComplex(args[0]),
z => ({re: -z.re, im: -z.im})])
}