Interface IDecimal<T>

A Decimal.js-compatible number. This matches Decimal.js's interface, without adding an explcit Decimal.js dependency.

Tested with Decimal.js itself, and break_infinity.js.

interface IDecimal<T> {
    abs(this): T;
    add(this, a): T;
    cbrt(this): T;
    div(this, a): T;
    equals(this, a): boolean;
    floor(this): T;
    gt(this, a): boolean;
    gte(this, a): boolean;
    lessThan(this, a): boolean;
    lt(this, a): boolean;
    lte(this, a): boolean;
    mul(this, a): T;
    pow(this, a): T;
    sqrt(this): T;
    sub(this, a): T;
    toNumber(this): number;
    toPrecision(n): string;
    toString(): string;
}

Type Parameters

  • T extends IDecimal<T>

    The number type. An implementation for the Decimal type would be typed as IDecimal<Decimal>.

Methods

  • Parameters

    • this: T
    • a: number | T

    Returns boolean

  • Parameters

    • this: T
    • a: number | T

    Returns boolean

Generated using TypeDoc