@neutrium/math - v2.2.0
    Preparing search index...

    Interface RationalArithmeticAdapter<T>

    Composite of ordinary arithmetic and all three optional rational capabilities.

    interface RationalArithmeticAdapter<T> {
        id: string;
        tier: "scientific" | "arithmetic";
        abs(value: T): T;
        add(a: T, b: T): T;
        ceil(value: T): T;
        compare(a: T, b: T): number;
        compareRationalSum(terms: Iterable<RationalTerm>): -1 | 0 | 1;
        div(a: T, b: T): T;
        floor(value: T): T;
        from(value: unknown): T;
        fromRationalSum(terms: Iterable<RationalTerm>): T;
        isFinite(value: T): boolean;
        isInteger(value: T): boolean;
        isNaN(value: T): boolean;
        isValue(value: unknown): value is T;
        mul(a: T, b: T): T;
        neg(value: T): T;
        powInteger(value: T, exponent: number): T;
        rem(a: T, b: T): T;
        round(value: T): T;
        sub(a: T, b: T): T;
        toBytes(value: T): number;
        toNumber(value: T): number;
        toRationalTerm(value: T): RationalTerm;
        toString(value: T): string;
        trunc(value: T): T;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implemented by

    Index
    id: string

    Diagnostic backend name, not a compatibility key.

    tier: "scientific" | "arithmetic"

    Available arithmetic capability tier.