UNPKG

1.89 kBTypeScriptView Raw
1/** Difference between closest possible IEEE 754 doubles between 1 and 2. */
2export declare const dblEpsilon: number;
3export declare class BigFloat {
4 /** Output EXACT value of an IEEE 754 double in base 2, 10 or 16.
5 * Exponent must be between -2 and 61, and last 3 bits of mantissa must be 0.
6 * Useful for debugging. */
7 static doubleToString(dbl: number, base?: number): string;
8 constructor(dbl?: number);
9 /** Set value from a floating point number (probably IEEE 754 double). */
10 setDouble(dbl: number): this;
11 /** Multiply by an integer and write output limbs to another list. */
12 private mulInt(factor, dstLimbList, srcPos, dstPos, overwriteMask);
13 private mulBig(multiplier);
14 /** Multiply and return product in a new BigFloat. */
15 mul(multiplier: number | BigFloat): BigFloat;
16 absDeltaFrom(other: BigFloat): number;
17 isZero(): boolean;
18 /** Return an arbitrary number with sign matching the result of this - other. */
19 deltaFrom(other: BigFloat): number;
20 private addBig(addend);
21 private subBig(subtrahend);
22 private addSub(addend, flip);
23 /** Add and return sum in a new BigFloat. */
24 add(addend: number | BigFloat): BigFloat;
25 /** Subtract and return difference in a new BigFloat. */
26 sub(subtrahend: number | BigFloat): BigFloat;
27 /** Divide by integer, replacing current value by quotient. Return integer remainder. */
28 private divInt(divisor);
29 private fractionToString(base, groupSize, digitList);
30 /** Convert to string in base 2, 10 or 16. */
31 toString(base?: number): string;
32 /** Remove leading and trailing insignificant zero digits. */
33 static trim(str: string): string;
34 private static padTbl;
35 isNegative: number;
36 fractionLen: number;
37 private static tempFloat;
38 /** List of digits in base 2^32, least significant first. */
39 private limbList;
40}