feat(Complex): support division
This commit is contained in:
parent
6775b66686
commit
102a7c42dc
3 changed files with 19 additions and 0 deletions
9
src/complex/invert.mjs
Normal file
9
src/complex/invert.mjs
Normal file
|
@ -0,0 +1,9 @@
|
|||
export * from './Types/Complex.mjs'
|
||||
|
||||
export const invert = {
|
||||
Complex: ({conjugate, absquare, complex, divide}) => z => {
|
||||
const c = conjugate(z)
|
||||
const d = absquare(z)
|
||||
return complex(divide(c.re, d), divide(c.im, d))
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ export {add} from './add.mjs'
|
|||
export {conjugate} from './conjugate.mjs'
|
||||
export {complex} from './complex.mjs'
|
||||
export {gcd} from './gcd.mjs'
|
||||
export {invert} from './invert.mjs'
|
||||
export {isZero} from './isZero.mjs'
|
||||
export {multiply} from './multiply.mjs'
|
||||
export {negate} from './negate.mjs'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue