mathjslab
Version:
MathJSLab - An interpreter with language syntax like MATLAB®/Octave, ISBN 978-65-00-82338-7.
193 lines (192 loc) • 13.9 kB
TypeScript
import { Decimal } from 'decimal.js';
import * as TypeOfComplex from './ComplexInterface';
import { Evaluator } from './Evaluator';
/**
* # `ComplexDecimal`
*
* An arbitrary precision complex number library.
*
* ## References
* * https://mathworld.wolfram.com/ComplexNumber.html
*/
declare class ComplexDecimal implements TypeOfComplex.ComplexInterface<Decimal, number, unknown> {
static readonly LOGICAL: number;
static readonly REAL: number;
static readonly COMPLEX: number;
static readonly defaultSettings: TypeOfComplex.ComplexConfig;
static readonly settings: TypeOfComplex.ComplexConfig;
static readonly isInstanceOf: TypeOfComplex.IsInstanceOfComplexHandler;
static readonly set: TypeOfComplex.SetComplexHandler;
re: Decimal;
im: Decimal;
type: number;
parent: any;
static readonly setNumberType: TypeOfComplex.OneArgNoReturnComplexHandler<Decimal, ComplexDecimal>;
constructor(re?: TypeOfComplex.NumLike<Decimal>, im?: TypeOfComplex.NumLike<Decimal>, type?: TypeOfComplex.NumType<number>, parent?: TypeOfComplex.NumParent<unknown>);
static readonly create: TypeOfComplex.CreateComplexHandler<Decimal, ComplexDecimal>;
static readonly realSet: TypeOfComplex.PartSetComplexHandler<Decimal, ComplexDecimal>;
static readonly imagSet: TypeOfComplex.PartSetComplexHandler<Decimal, ComplexDecimal>;
static readonly realApply: TypeOfComplex.PartApplyComplexHandler<Decimal, ComplexDecimal>;
static readonly imagApply: TypeOfComplex.PartApplyComplexHandler<Decimal, ComplexDecimal>;
static readonly from: (obj: ComplexDecimal) => ComplexDecimal;
static readonly real: (z: ComplexDecimal) => ComplexDecimal;
static readonly imag: (z: ComplexDecimal) => ComplexDecimal;
static readonly realIsInteger: (z: ComplexDecimal) => boolean;
static readonly imagIsInteger: (z: ComplexDecimal) => boolean;
static readonly realIsFinite: (z: ComplexDecimal) => boolean;
static readonly imagIsFinite: (z: ComplexDecimal) => boolean;
static readonly realIsNaN: (z: ComplexDecimal) => boolean;
static readonly imagIsNaN: (z: ComplexDecimal) => boolean;
static readonly realIsNegative: (z: ComplexDecimal) => boolean;
static readonly imagIsNegative: (z: ComplexDecimal) => boolean;
static readonly realIsZero: (z: ComplexDecimal) => boolean;
static readonly imagIsZero: (z: ComplexDecimal) => boolean;
static readonly realIsPositive: (z: ComplexDecimal) => boolean;
static readonly imagIsPositive: (z: ComplexDecimal) => boolean;
static readonly realToNumber: (z: ComplexDecimal) => number;
static readonly imagToNumber: (z: ComplexDecimal) => number;
static readonly realLessThan: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly imagLessThan: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly realLessThanOrEqualTo: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly imagLessThanOrEqualTo: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly realEquals: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly imagEquals: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly realGreaterThanOrEqualTo: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly imagGreaterThanOrEqualTo: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly realGreaterThan: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly imagGreaterThan: (z: ComplexDecimal, value: Decimal.Value) => boolean;
static readonly parse: TypeOfComplex.ParseComplexHandler<Decimal, ComplexDecimal>;
static readonly unparseValue: TypeOfComplex.UnparseValueComplexHandler<Decimal>;
static readonly unparse: TypeOfComplex.UnparseComplexHandler<Decimal, ComplexDecimal, number>;
unparse(): string;
static readonly unparseMathMLValue: TypeOfComplex.UnparseValueComplexHandler<Decimal>;
static readonly precedence: TypeOfComplex.PrecedenceComplexHandler<Decimal, ComplexDecimal, Evaluator, number>;
static readonly unparseMathML: TypeOfComplex.UnparseMathMLComplexHandler<Decimal, ComplexDecimal, Evaluator, number>;
static copy: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
copy: () => ComplexDecimal;
static toMaxPrecisionValue: TypeOfComplex.OneArgValueComplexHandler<Decimal>;
static toMaxPrecision: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static epsilonValue: () => Decimal;
static epsilon: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static random: TypeOfComplex.RandomComplexHandler<Decimal, ComplexDecimal>;
static eq: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static ne: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static compareValue: TypeOfComplex.CompareValueComplexHandler<Decimal>;
static cmp: TypeOfComplex.CmpComplexHandler<Decimal, ComplexDecimal>;
static minMaxArrayReal: TypeOfComplex.MinMaxArrayComplexHandler<Decimal, ComplexDecimal>;
static minMaxArrayRealWithIndex: TypeOfComplex.MinMaxArrayWithIndexComplexHandler<Decimal, ComplexDecimal>;
static minMaxArrayComplex: TypeOfComplex.MinMaxArrayComplexHandler<Decimal, ComplexDecimal>;
static minMaxArrayComplexWithIndex: TypeOfComplex.MinMaxArrayWithIndexComplexHandler<Decimal, ComplexDecimal>;
static min: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static minWise: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static max: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static maxWise: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static lt: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static le: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static gt: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static ge: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static false: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static true: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static logical: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static toLogical: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
toLogical: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static and: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static or: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static xor: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static not: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static zero: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static one: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static onediv2: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static minusonediv2: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static minusone: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static pi: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static pidiv2: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static onei: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static onediv2i: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static minusonediv2i: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static minusonei: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static two: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static sqrt2pi: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static e: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static NaN_0: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static inf_0: TypeOfComplex.NoArgComplexHandler<Decimal, ComplexDecimal>;
static add: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static sub: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static neg: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static mul: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static rdiv: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static ldiv: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static inv: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static power: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static root: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static absValue: TypeOfComplex.AbsoluteValueComplexHandler<Decimal, ComplexDecimal>;
static abs: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static hypot: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static arg: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static conj: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static mod: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static rem: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static fix: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static ceil: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static floor: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static round: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sign: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sqrt: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static exp: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static log: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static logb: TypeOfComplex.TwoArgComplexHandler<Decimal, ComplexDecimal>;
static log2: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static log10: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static deg2rad: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static rad2deg: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sin: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sind: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cos: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cosd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static tan: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static tand: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static csc: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cscd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sec: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static secd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cot: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cotd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asin: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asind: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acos: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acosd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static atan: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static atand: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acsc: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acscd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asec: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asecd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acot: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acotd: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sinh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static cosh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static tanh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static csch: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static sech: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static coth: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asinh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acosh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static atanh: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acsch: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static asech: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static acoth: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static gamma: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static factorial: TypeOfComplex.OneArgComplexHandler<Decimal, ComplexDecimal>;
static readonly applyFunction: TypeOfComplex.PartApplyComplexHandlerTable<Decimal>;
static mapFunction: Record<string, (z: ComplexDecimal) => ComplexDecimal>;
static twoArgFunction: Record<string, (x: ComplexDecimal, y: ComplexDecimal) => ComplexDecimal>;
}
/**
* The static type ensures compatibility with the contract (TypeOfComplex.ComplexInterface).
*/
type ComplexDecimalStatic = typeof ComplexDecimal extends TypeOfComplex.ComplexInterfaceStatic<Decimal, ComplexDecimal> ? typeof ComplexDecimal : never;
export { Decimal, type ComplexDecimalStatic, ComplexDecimal };
declare const _default: {
ComplexDecimal: typeof ComplexDecimal;
};
export default _default;