-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathfraction.d.ts
More file actions
79 lines (66 loc) · 2.01 KB
/
fraction.d.ts
File metadata and controls
79 lines (66 loc) · 2.01 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
declare class Fraction {
constructor();
constructor(num: Fraction.FractionInput);
constructor(numerator: number | bigint, denominator: number | bigint);
s: bigint;
n: bigint;
d: bigint;
abs(): Fraction;
neg(): Fraction;
add: Fraction.FractionParam;
sub: Fraction.FractionParam;
mul: Fraction.FractionParam;
div: Fraction.FractionParam;
pow: Fraction.FractionParam;
log: Fraction.FractionParam;
gcd: Fraction.FractionParam;
lcm: Fraction.FractionParam;
mod(): Fraction;
mod(num: Fraction.FractionInput): Fraction;
ceil(places?: number): Fraction;
floor(places?: number): Fraction;
round(places?: number): Fraction;
roundTo: Fraction.FractionParam;
inverse(): Fraction;
simplify(eps?: number): Fraction;
equals(num: Fraction.FractionInput): boolean;
lt(num: Fraction.FractionInput): boolean;
lte(num: Fraction.FractionInput): boolean;
gt(num: Fraction.FractionInput): boolean;
gte(num: Fraction.FractionInput): boolean;
compare(num: Fraction.FractionInput): number;
divisible(num: Fraction.FractionInput): boolean;
valueOf(): number;
toString(decimalPlaces?: number): string;
toLatex(showMixed?: boolean): string;
toFraction(showMixed?: boolean): string;
toContinued(): bigint[];
clone(): Fraction;
static default: typeof Fraction;
static Fraction: typeof Fraction;
}
declare namespace Fraction {
interface NumeratorDenominator { n: number | bigint; d: number | bigint; }
type FractionInput =
| Fraction
| number
| bigint
| string
| [number | bigint | string, number | bigint | string]
| NumeratorDenominator;
type FractionParam = {
(numerator: number | bigint, denominator: number | bigint): Fraction;
(num: FractionInput): Fraction;
};
}
/**
* Export matches CJS runtime:
* module.exports = Fraction;
* module.exports.default = Fraction;
* module.exports.Fraction = Fraction;
*/
declare const FractionExport: typeof Fraction & {
default: typeof Fraction;
Fraction: typeof Fraction;
};
export = FractionExport;