-
Notifications
You must be signed in to change notification settings - Fork 7
/
BigDecimal.d.ts
38 lines (31 loc) · 1.68 KB
/
BigDecimal.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
type RoundingMode = "floor" | "down" | "ceil" | "up" | "half-even" | "half-up" | "half-down";
interface Rounding {
roundingMode: RoundingMode;
maximumSignificantDigits?: number;
maximumFractionDigits?: number;
}
declare class BigDecimal {
static BigDecimal(value: string | number | bigint | BigDecimal): BigDecimal;
static unaryMinus(a: BigDecimal): BigDecimal;
static add(a: BigDecimal, b: BigDecimal, rounding?: Rounding): BigDecimal;
static subtract(a: BigDecimal, b: BigDecimal, rounding?: Rounding): BigDecimal;
static multiply(a: BigDecimal, b: BigDecimal, rounding?: Rounding): BigDecimal;
static divide(a: BigDecimal, b: BigDecimal, rounding?: Rounding): BigDecimal;
static cmp(a: BigDecimal, b: BigDecimal): boolean;
static round(a: BigDecimal, rounding: Rounding): BigDecimal;
toString(): string;
toFixed(fractionDigits: number, roundingMode?: RoundingMode): string;
toPrecision(precision: number, roundingMode?: RoundingMode): string;
toExponential(fractionDigits: number, roundingMode?: RoundingMode): string;
static log(a: BigDecimal, rounding: Rounding): BigDecimal;
static exp(a: BigDecimal, rounding: Rounding): BigDecimal;
static sin(a: BigDecimal, rounding: Rounding): BigDecimal;
static cos(a: BigDecimal, rounding: Rounding): BigDecimal;
static atan(a: BigDecimal, rounding: Rounding): BigDecimal;
static sqrt(a: BigDecimal, rounding: Rounding): BigDecimal;
static abs(a: BigDecimal): BigDecimal;
static sign(a: BigDecimal): number;
static max(a: BigDecimal, b: BigDecimal): BigDecimal;
static min(a: BigDecimal, b: BigDecimal): BigDecimal;
}
export { BigDecimal, Rounding, RoundingMode };