/** * Typed Relational Functions * * Polymorphic relational operations using typed-function for runtime dispatch. * Supports number, BigNumber, Fraction, Complex, bigint, boolean, string, and Array types. * * These are clean implementations using mathTyped dispatch — the activated * mathjs-derived layer under functions/src/relational/ is left untouched here * and used only as an algorithm reference. * * Semantics follow the mathjs convention: * - nearlyEqual tolerance uses DEFAULT_CONFIG.relTol / absTol. * - deepEqual recurses over nested arrays; non-array scalars delegate to equalScalar. * - compareNatural orders mixed types by type name (natural sort) as a tiebreak. * - compareText is pure lexicographic (locale-independent). * - equalText delegates to compareText === 0. * - equalScalar uses tolerance for number/BigNumber/Complex; exact for others. * - unequal is the negation of equalScalar (with null/undefined strict handling). * - compareUnits requires same-base units; delegates value comparison recursively. * * @packageDocumentation */ /** * Test whether two scalar values are nearly equal. * * Uses configured relTol / absTol for number, BigNumber, and Complex. * Uses exact equality for Fraction, bigint, and boolean. * null and undefined only equal themselves. * * @example * ```typescript * equalScalar(1, 1) // true * equalScalar(1, 1 + 1e-16) // true (within tolerance) * equalScalar(new Fraction(1, 3), new Fraction(1, 3)) // true * equalScalar(null, null) // true * equalScalar(null, 0) // false * ``` */ export declare const equalScalar: import("@danielsimonjr/mathts-core").TypedFunction; /** * Test whether two values are unequal. * * null and undefined are compared strictly: null is only equal to null, * undefined is only equal to undefined. * * @example * ```typescript * unequal(2 + 2, 3) // true * unequal(2 + 2, 4) // false * unequal(0, null) // true * ``` */ export declare const unequal: import("@danielsimonjr/mathts-core").TypedFunction; /** * Test element-wise whether two arrays (or scalars) are equal. * * For arrays: recursively tests each element pair; arrays of different lengths * are unequal. For scalars: delegates to equalScalar. * * @example * ```typescript * deepEqual(2, 4) // false * deepEqual([2, 5, 1], [2, 5, 1]) // true * deepEqual([2, 5, 1], [2, 7, 1]) // false * deepEqual([[1, 2], [3, 4]], [[1, 2], [3, 4]]) // true * ``` */ export declare const deepEqual: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compare two strings lexically (case-sensitive, locale-independent). * Returns 1 when x > y, -1 when x < y, and 0 when x == y. * * @example * ```typescript * compareText('B', 'A') // 1 * compareText('2', '10') // 1 (lexicographic; '2' > '1') * compareText('a', 'a') // 0 * ``` */ export declare const compareText: import("@danielsimonjr/mathts-core").TypedFunction; /** * Check equality of two strings. Comparison is case-sensitive. * * @example * ```typescript * equalText('Hello', 'Hello') // true * equalText('a', 'A') // false * ``` */ export declare const equalText: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compare two values of any type in a deterministic, natural way. * * For numeric types (number, BigNumber, Fraction), uses tolerance-aware comparison. * For strings, uses natural sort (so "10" > "2"). * For Complex numbers, compares real part first then imaginary. * For arrays, compares element-by-element then by length. * For objects, compares sorted keys then values. * For mixed types, orders by type name (natural sort as tiebreak). * * Returns 1 when x > y, -1 when x < y, and 0 when x == y. * * @example * ```typescript * compareNatural(6, 1) // 1 * compareNatural('10', '2') // 1 (natural sort) * compareNatural([1, 2, 4], [1, 2, 3]) // 1 * compareNatural({a: 2}, {a: 4}) // -1 * ``` */ export declare const compareNatural: import("@danielsimonjr/mathts-core").TypedFunction; /** * Compare two Unit values. * * Both units must have the same dimensional base; otherwise an error is thrown. * The underlying numeric values are then compared using compareNatural. * * @example * ```typescript * // compareUnits(math.unit('5 cm'), math.unit('40 mm')) // 1 (5 cm > 4 cm) * ``` */ export declare const compareUnits: import("@danielsimonjr/mathts-core").TypedFunction; /** * All typed relational functions. */ export declare const typedRelational: { equalScalar: import("@danielsimonjr/mathts-core").TypedFunction; unequal: import("@danielsimonjr/mathts-core").TypedFunction; deepEqual: import("@danielsimonjr/mathts-core").TypedFunction; compareText: import("@danielsimonjr/mathts-core").TypedFunction; equalText: import("@danielsimonjr/mathts-core").TypedFunction; compareNatural: import("@danielsimonjr/mathts-core").TypedFunction; compareUnits: import("@danielsimonjr/mathts-core").TypedFunction; }; //# sourceMappingURL=relational.d.ts.map