/** * Local Decimal implementation for arbitrary precision arithmetic. * Replaces the external 'decimal.js' library. * * This implementation uses BigInt for arbitrary precision integer arithmetic * and tracks a decimal exponent for floating point representation. */ export declare const ROUND_UP = 0; export declare const ROUND_DOWN = 1; export declare const ROUND_CEIL = 2; export declare const ROUND_FLOOR = 3; export declare const ROUND_HALF_UP = 4; export declare const ROUND_HALF_DOWN = 5; export declare const ROUND_HALF_EVEN = 6; export declare const ROUND_HALF_CEIL = 7; export declare const ROUND_HALF_FLOOR = 8; export declare const EUCLID = 9; /** Configuration options for the Decimal class (precision, rounding mode, exponent limits). */ export interface DecimalConfig { precision?: number; rounding?: number; toExpNeg?: number; toExpPos?: number; minE?: number; maxE?: number; } /** * Decimal class for arbitrary precision arithmetic. */ export declare class Decimal { /** Coefficient digits as array of numbers (0-9) */ d: number[] | null; /** Exponent (power of 10) */ e: number; /** Sign: -1, 0, or 1 */ s: number; /** Rounding mode constants */ static readonly ROUND_UP = 0; static readonly ROUND_DOWN = 1; static readonly ROUND_CEIL = 2; static readonly ROUND_FLOOR = 3; static readonly ROUND_HALF_UP = 4; static readonly ROUND_HALF_DOWN = 5; static readonly ROUND_HALF_EVEN = 6; static readonly ROUND_HALF_CEIL = 7; static readonly ROUND_HALF_FLOOR = 8; static readonly EUCLID = 9; /** Current precision */ static get precision(): number; constructor(value: number | string | bigint | Decimal | { n: bigint; d: bigint; s?: number; }); private divideStrings; private static parseString; /** * Configure global settings */ static config(options: DecimalConfig): typeof Decimal; /** * Create a new Decimal constructor with custom configuration */ static clone(options?: DecimalConfig): typeof Decimal; /** * Check if value is a Decimal */ static isDecimal(value: unknown): value is Decimal; /** * Get maximum of values */ static max(...values: (Decimal | number | string)[]): Decimal; /** * Get minimum of values */ static min(...values: (Decimal | number | string)[]): Decimal; /** * Two-argument arctangent */ static atan2(y: Decimal | number | string, x: Decimal | number | string): Decimal; /** * Arc cosine (static) */ static acos(value: Decimal | number | string): Decimal; private static fromBigInt; private cmpAbs; /** * Addition */ plus(other: Decimal | number | string): Decimal; /** * Subtraction */ minus(other: Decimal | number | string): Decimal; /** * Multiplication */ times(other: Decimal | number | string): Decimal; /** * Multiplication (alias) */ mul(other: Decimal | number | string): Decimal; /** * Division */ div(other: Decimal | number | string): Decimal; /** * Modulo */ mod(other: Decimal | number | string): Decimal; /** * Power */ pow(exp: Decimal | number | string): Decimal; /** * Square root */ sqrt(): Decimal; /** * Cube root */ cbrt(): Decimal; /** * Natural logarithm */ ln(): Decimal; /** * Logarithm (base 10 or specified) */ log(base?: Decimal | number | string): Decimal; /** * Exponential (e^x) */ exp(): Decimal; sin(): Decimal; cos(): Decimal; tan(): Decimal; asin(): Decimal; acos(): Decimal; atan(): Decimal; sinh(): Decimal; cosh(): Decimal; tanh(): Decimal; asinh(): Decimal; acosh(): Decimal; atanh(): Decimal; /** * Absolute value */ abs(): Decimal; /** * Negate */ neg(): Decimal; /** * Floor */ floor(): Decimal; /** * Ceiling */ ceil(): Decimal; /** * Round */ round(): Decimal; /** * Round to decimal places */ toDecimalPlaces(places: number, roundingMode?: number): Decimal; private shouldRoundUp; /** * Round to significant figures */ toSignificantDigits(sd: number, roundingMode?: number): Decimal; /** * Convert to fixed-point string */ toFixed(places?: number): string; /** * Convert to exponential notation */ toExponential(places?: number): string; /** * Convert to precision */ toPrecision(sd?: number): string; equals(other: Decimal | number | string): boolean; eq(other: Decimal | number | string): boolean; greaterThan(other: Decimal | number | string): boolean; gt(other: Decimal | number | string): boolean; greaterThanOrEqual(other: Decimal | number | string): boolean; gte(other: Decimal | number | string): boolean; lessThan(other: Decimal | number | string): boolean; lt(other: Decimal | number | string): boolean; lessThanOrEqual(other: Decimal | number | string): boolean; lte(other: Decimal | number | string): boolean; cmp(other: Decimal | number | string): number; compareTo(other: Decimal | number | string): number; isNegative(): boolean; isNeg(): boolean; isPositive(): boolean; isZero(): boolean; isNaN(): boolean; isFinite(): boolean; isInteger(): boolean; isInt(): boolean; /** * Clone */ clone(): Decimal; /** * Convert to number */ toNumber(): number; /** * Convert to string */ toString(): string; valueOf(): number; } export default Decimal; //# sourceMappingURL=Decimal.d.ts.map