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

    Interface ArithmeticAdapter<T>

    Core plus nonmutating arithmetic and integer rounding.

    interface ArithmeticAdapter<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;
        div(a: T, b: T): T;
        floor(value: T): T;
        from(value: unknown): 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;
        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.

    • Raise to a finite integer Number exponent without rounding the exponent into the scalar format. Fractional/nonfinite exponents throw RangeError; Decimal additionally requires a safe integer.

      Parameters

      • value: T
      • exponent: number

      Returns T