/** * Exact surd values — the engine's exact-number domain beyond ℚ. * * A value is `q₀ + Σ qᵢ·√nᵢ` (qᵢ ∈ Rational, nᵢ distinct square-free integers). * Internally one Map keyed by square-free radicand (`1n` is the rational part); * every stored coefficient is nonzero, so canonical form makes equality * STRUCTURAL — which is sound because the √ of distinct square-free integers are * ℚ-linearly independent, so `q₀ + Σ qᵢ√nᵢ = 0` iff every qᵢ = 0. * * Closed under `+ − ×`, and under `÷` for the cases quadratic work produces: * division by a rational, or by a single-radical value `a + b√n` (via its * conjugate). A denominator with TWO OR MORE distinct radicals needs * multiquadratic rationalization — out of scope here, so `inverse()` returns * `undefined` (an honest undefined point, never an approximation). `√` of a * negative is `undefined` too (complex numbers are a later step). * * No floating point, no DOM — exact bigint/Rational arithmetic only. */ import { Rational } from "./rational.js"; /** Write n = coeff²·radicand with radicand square-free (n ≥ 1). */ export declare function squareFreeFactor(n: bigint): { coeff: bigint; radicand: bigint; }; export declare class Surd { readonly terms: ReadonlyMap; /** square-free radicand (1n = rational part) → nonzero coefficient */ private constructor(); /** Drop zero coefficients so equality can stay structural. */ private static build; static rational(r: Rational): Surd; static readonly zero: Surd; static readonly one: Surd; /** √v for a non-negative rational v, as an exact surd; undefined if v < 0. */ static sqrt(v: Rational): Surd | undefined; get rationalPart(): Rational; isRational(): boolean; asRational(): Rational | undefined; isZero(): boolean; neg(): Surd; add(o: Surd): Surd; sub(o: Surd): Surd; mul(o: Surd): Surd; /** Integer power. Negative exponents need `inverse()`, so they return * undefined for zero (0⁻ⁿ) or ≥2-radical bases. `x⁰ = 1` (incl. `0⁰`, * matching the exact evaluator). */ powInt(e: bigint): Surd | undefined; /** Multiplicative inverse, or undefined when zero or when ≥2 radicals appear. */ inverse(): Surd | undefined; div(o: Surd): Surd | undefined; equals(o: Surd): boolean; toString(): string; } //# sourceMappingURL=surd.d.ts.map