/** * Exact rational arithmetic over bigint. No floating point is ever used in * correctness checks — rule property tests compare equation truth values * computed with this type. * * Always normalized: den > 0, gcd(|num|, den) === 1, and 0 is 0/1. */ export declare class Rational { readonly num: bigint; readonly den: bigint; constructor(num: bigint, den?: bigint); static of(n: bigint | number): Rational; /** Parse "3", "-3", or "3/4" (whitespace tolerated). Undefined on anything else. */ static parse(s: string): Rational | undefined; static readonly zero: Rational; static readonly one: Rational; add(o: Rational): Rational; sub(o: Rational): Rational; mul(o: Rational): Rational; div(o: Rational): Rational; neg(): Rational; /** Integer exponent only; negative exponents of zero throw. */ powInt(e: bigint): Rational; isZero(): boolean; isInteger(): boolean; equals(o: Rational): boolean; /** Exact ordering: -1, 0, or 1. */ compare(o: Rational): -1 | 0 | 1; toString(): string; } export declare class DivisionByZero extends Error { constructor(); } /** Greatest common divisor; expects non-negative inputs. */ export declare function gcd(a: bigint, b: bigint): bigint; //# sourceMappingURL=rational.d.ts.map