typocomath/src/interfaces/arithmetic.ts

19 lines
614 B
TypeScript

import type {Complex} from '../Complex/type.js'
import type {RealType} from './type.js'
declare module "./type" {
interface Signatures<T> {
add: (a: T, b: T) => T
unaryMinus: (a: T) => T
conj: (a: T) => T
subtract: (a: T, b: T) => T
multiply: (a: T, b: T) => T
square: (a: T) => T
absquare: (a: T) => RealType<T>
reciprocal: (a: T) => T
divide: (a: T, b: T) => T
conservativeSqrt: (a: T) => T
sqrt: (a: T)=> T extends Complex<unknown> ? T : T | Complex<T>
}
}