typocomath/src/interfaces/arithmetic.ts

29 lines
1.0 KiB
TypeScript

// shared interfaces
import { Complex } from "../Complex/type"
// Note: right now I've added an 'Fn*' prefix,
// so it is clear that the type hold a function type definition
// This is not necessary though, it is just a naming convention.
export type FnAdd<T> = (a: T, b: T) => T
export type FnAddReal<T, U> = (a: T, b: U) => T
export type FnUnaryMinus<T> = (a: T) => T
export type FnConj<T> = (a: T) => T
export type FnSubtract<T> = (a: T, b: T) => T
export type FnMultiply<T> = (a: T, b: T) => T
export type FnAbsSquare<T, U> = (a: T) => U
export type FnReciprocal<T> = (a: T) => T
export type FnDivide<T> = (a: T, b: T) => T
export type FnDivideByReal<T, U> = (a: T, b: U) => T
export type FnConservativeSqrt<T> = (a: T) => T
export type FnSqrt<T> = (a: T) => T | Complex<T>
export type FnSquare<T> = (z: T) => T
export type FnIsReal<T> = (a: T) => boolean
export type FnIsSquare<T> = (a: T) => boolean
export type FnZero<T> = (a: T) => T
export type FnOne<T> = (a: T) => T
export type FnNaN<T> = (a: T) => T
export type FnRe<T, U> = (a: T) => U