/** * Exact rational arithmetic (lowest-terms, positive denominator). * Shared by the Layer 1–3 rational-function integrators so those modules * can import each other without a cycle. */ /** Exact rational number with a bigint numerator `num` and denominator `den`. */ export interface Rat { num: bigint; den: bigint; } /** * Return the rational `num / den` in lowest terms, with a positive denominator. * * A zero numerator gives `0 / 1`. * * @throws Error if `den` is 0. */ export declare function ratNormalize(num: bigint, den: bigint): Rat; /** Return the sum `a + b` in lowest terms. */ export declare function ratAdd(a: Rat, b: Rat): Rat; /** Return the difference `a - b` in lowest terms. */ export declare function ratSub(a: Rat, b: Rat): Rat; /** Return the product `a * b` in lowest terms. */ export declare function ratMul(a: Rat, b: Rat): Rat; /** * Return the quotient `a / b` in lowest terms. * * @throws Error if `b` is 0. */ export declare function ratDiv(a: Rat, b: Rat): Rat; /** Return the integer `n` as the rational `n / 1`. */ export declare function ratFromBigint(n: bigint): Rat; export declare const RAT_ZERO: Rat; //# sourceMappingURL=rat.d.ts.map