Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1x 1x 1x 4x 4x | import absImpl from '../internal/absImpl'; import { IComplex, IComplexConstructor } from '../internal/complex'; import mask from '../internal/mask'; import getAbs from '../methods/getAbs'; export default function abs<T extends IComplex>(Complex: IComplexConstructor<T>, z: IComplex | number, i = 0): T { const zAbs = typeof z === 'number' ? absImpl(z, i) : getAbs(z); return new Complex(zAbs, 0, zAbs, 0, mask.HAS_ALL); } |