picomath/complex/negate.js

7 lines
199 B
JavaScript
Raw Normal View History

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