-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdashu.pyi
More file actions
493 lines (469 loc) · 19.9 KB
/
Copy pathdashu.pyi
File metadata and controls
493 lines (469 loc) · 19.9 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
from typing import overload, Literal, Optional, Tuple, Iterable, Union
# A native Python number or any dashu number.
Number = Union[int, float, "UBig", "IBig", "FBig", "DBig", "RBig"]
# Sign of a number.
class Sign:
Positive: Sign
Negative: Sign
class Words:
def __init__(self, obj: list[int] | Words) -> None: ...
def __repr__(self) -> str: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, index: int) -> int: ...
@overload
def __getitem__(self, index: slice) -> Words: ...
def __setitem__(self, index: int | slice, value: int | list[int] | Words) -> None: ...
def __delitem__(self, index: int | slice) -> None: ...
def __add__(self, other: list[int] | Words) -> Words: ...
def __mul__(self, count: int) -> Words: ...
class UBig:
def __init__(self, obj: int | str, radix: Optional[int] = ...) -> None: ...
def unwrap(self) -> int: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, index: int) -> bool: ...
@overload
def __getitem__(self, index: slice) -> UBig: ...
def __setitem__(self, index: int | slice, value: bool) -> None: ...
def __delitem__(self, index: int | slice) -> None: ...
def __int__(self) -> int: ...
# arithmetic (cross-type dispatch)
def __add__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __radd__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __sub__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rsub__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __mul__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rmul__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __truediv__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rtruediv__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __floordiv__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __rfloordiv__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __mod__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __divmod__(self, other: int | UBig | IBig) -> tuple: ...
def __pow__(self, exp: int | UBig, modulus: Optional[int | UBig] = ...) -> UBig: ...
def __iadd__(self, other: int | UBig) -> None: ...
def __isub__(self, other: int | UBig) -> None: ...
def __imul__(self, other: int | UBig) -> None: ...
def __iand__(self, other: int | UBig) -> None: ...
def __ior__(self, other: int | UBig) -> None: ...
def __ixor__(self, other: int | UBig) -> None: ...
def __ilshift__(self, other: int) -> None: ...
def __irshift__(self, other: int) -> None: ...
def __pos__(self) -> UBig: ...
def __neg__(self) -> IBig: ...
def __abs__(self) -> UBig: ...
def __lshift__(self, other: int) -> UBig: ...
def __rshift__(self, other: int) -> UBig: ...
def __and__(self, other: int | UBig | IBig) -> UBig: ...
def __or__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __xor__(self, other: int | UBig | IBig) -> UBig | IBig: ...
# comparisons (cross-type)
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: Number) -> bool: ...
def __le__(self, other: Number) -> bool: ...
def __gt__(self, other: Number) -> bool: ...
def __ge__(self, other: Number) -> bool: ...
# number theory & roots
def sqrt(self) -> UBig: ...
def cbrt(self) -> UBig: ...
def nth_root(self, n: int) -> UBig: ...
def sqr(self) -> UBig: ...
def cubic(self) -> UBig: ...
def ilog(self, base: int | UBig) -> int: ...
def is_multiple_of(self, divisor: int | UBig) -> bool: ...
def remove(self, factor: int | UBig) -> int: ...
def gcd(self, other: int | UBig) -> UBig: ...
def gcd_ext(self, other: int | UBig) -> tuple[UBig, IBig, IBig]: ...
# bit operations
def count_ones(self) -> int: ...
def count_zeros(self) -> Optional[int]: ...
def trailing_zeros(self) -> Optional[int]: ...
def trailing_ones(self) -> Optional[int]: ...
def is_power_of_two(self) -> bool: ...
def next_power_of_two(self) -> UBig: ...
# accessors
def is_one(self) -> bool: ...
@staticmethod
def ones(n: int) -> UBig: ...
# interop
def to_words(self) -> Words: ...
@staticmethod
def from_words(words: list[int] | Words) -> UBig: ...
def to_bytes(self, byteorder: Optional[Literal["little", "big"]] = ...) -> bytes: ...
@staticmethod
def from_bytes(bytes: bytes, byteorder: Optional[Literal["little", "big"]] = ...) -> UBig: ...
def to_chunks(self, chunk_bits: int) -> tuple[UBig, ...]: ...
@staticmethod
def from_chunks(chunks: Iterable[UBig], chunk_bits: int) -> UBig: ...
class IBig:
def __init__(self, obj: int | str, radix: Optional[int] = ...) -> None: ...
def unwrap(self) -> int: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def __getitem__(self, index: int) -> bool: ...
def __int__(self) -> int: ...
# arithmetic, comparisons, in-place: same cross-type surface as UBig
def __add__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __radd__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __sub__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rsub__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __mul__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rmul__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __truediv__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __rtruediv__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __floordiv__(self, other: int | UBig | IBig) -> IBig: ...
def __rfloordiv__(self, other: int | UBig | IBig) -> IBig: ...
def __mod__(self, other: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def __divmod__(self, other: int | UBig | IBig) -> tuple: ...
def __pow__(self, exp: int | UBig, modulus: Optional[int | UBig] = ...) -> IBig: ...
def __iadd__(self, other: int | IBig) -> None: ...
def __isub__(self, other: int | IBig) -> None: ...
def __imul__(self, other: int | IBig) -> None: ...
def __iand__(self, other: int | IBig) -> None: ...
def __ior__(self, other: int | IBig) -> None: ...
def __ixor__(self, other: int | IBig) -> None: ...
def __ilshift__(self, other: int) -> None: ...
def __irshift__(self, other: int) -> None: ...
def __pos__(self) -> IBig: ...
def __neg__(self) -> IBig: ...
def __abs__(self) -> IBig: ...
def __invert__(self) -> IBig: ...
def __lshift__(self, other: int) -> IBig: ...
def __rshift__(self, other: int) -> IBig: ...
def __and__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __or__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __xor__(self, other: int | UBig | IBig) -> UBig | IBig: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: Number) -> bool: ...
def __le__(self, other: Number) -> bool: ...
def __gt__(self, other: Number) -> bool: ...
def __ge__(self, other: Number) -> bool: ...
# number theory & roots
def sqrt(self) -> UBig: ...
def cbrt(self) -> IBig: ...
def nth_root(self, n: int) -> IBig: ...
def sqr(self) -> UBig: ...
def cubic(self) -> IBig: ...
def ilog(self, base: int | UBig) -> int: ...
def trailing_zeros(self) -> Optional[int]: ...
def trailing_ones(self) -> Optional[int]: ...
def is_one(self) -> bool: ...
def sign(self) -> Sign: ...
def signum(self) -> IBig: ...
def is_negative(self) -> bool: ...
def is_positive(self) -> bool: ...
def to_parts(self) -> tuple[Sign, UBig]: ...
@staticmethod
def from_parts(sign: Sign, magnitude: int | UBig) -> IBig: ...
def as_ubig(self) -> Optional[UBig]: ...
@staticmethod
def ones(n: int) -> IBig: ...
def to_words(self) -> Words: ...
@staticmethod
def from_words(words: list[int] | Words) -> IBig: ...
def to_chunks(self, chunk_bits: int) -> tuple[UBig, ...]: ...
@staticmethod
def from_chunks(chunks: Iterable[UBig], chunk_bits: int) -> IBig: ...
def to_bytes(
self, byteorder: Optional[Literal["little", "big"]] = ..., signed: Optional[bool] = ...
) -> bytes: ...
@staticmethod
def from_bytes(
bytes: bytes,
byteorder: Optional[Literal["little", "big"]] = ...,
signed: Optional[bool] = ...,
) -> IBig: ...
class FBig:
def __init__(self, obj: float | int | str | "FBig") -> None: ...
def unwrap(self) -> tuple[IBig, int]: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
def __add__(self, other: Number) -> FBig: ...
def __radd__(self, other: Number) -> FBig: ...
def __sub__(self, other: Number) -> FBig: ...
def __rsub__(self, other: Number) -> FBig: ...
def __mul__(self, other: Number) -> FBig: ...
def __rmul__(self, other: Number) -> FBig: ...
def __truediv__(self, other: Number) -> FBig: ...
def __rtruediv__(self, other: Number) -> FBig: ...
def __mod__(self, other: Number) -> FBig: ...
def __rmod__(self, other: Number) -> FBig: ...
def __neg__(self) -> FBig: ...
def __pos__(self) -> FBig: ...
def __abs__(self) -> FBig: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: Number) -> bool: ...
def __le__(self, other: Number) -> bool: ...
def __gt__(self, other: Number) -> bool: ...
def __ge__(self, other: Number) -> bool: ...
# predicates & sign
def is_zero(self) -> bool: ...
def is_finite(self) -> bool: ...
def is_infinite(self) -> bool: ...
def sign(self) -> Sign: ...
# rounding
def trunc(self) -> FBig: ...
def floor(self) -> FBig: ...
def ceil(self) -> FBig: ...
def round(self) -> FBig: ...
def fract(self) -> FBig: ...
# precision & parts
def precision(self) -> int: ...
def digits(self) -> int: ...
def with_precision(self, precision: int) -> FBig: ...
@staticmethod
def from_parts(significand: int | IBig, exponent: int) -> FBig: ...
# conversions
def to_int(self) -> IBig: ...
def to_decimal(self) -> DBig: ...
def to_binary(self) -> FBig: ...
def to_rational(self) -> RBig: ...
# transcendentals (panic-free; domain errors raise ValueError)
def sin(self) -> FBig: ...
def cos(self) -> FBig: ...
def tan(self) -> FBig: ...
def asin(self) -> FBig: ...
def acos(self) -> FBig: ...
def atan(self) -> FBig: ...
def atan2(self, x: float | int | FBig) -> FBig: ...
def sinh(self) -> FBig: ...
def cosh(self) -> FBig: ...
def tanh(self) -> FBig: ...
def asinh(self) -> FBig: ...
def acosh(self) -> FBig: ...
def atanh(self) -> FBig: ...
def exp(self) -> FBig: ...
def exp_m1(self) -> FBig: ...
def ln(self) -> FBig: ...
def ln_1p(self) -> FBig: ...
def sqrt(self) -> FBig: ...
def cbrt(self) -> FBig: ...
def nth_root(self, n: int) -> FBig: ...
def powf(self, w: float | int | FBig) -> FBig: ...
def powi(self, n: int | IBig) -> FBig: ...
class DBig:
def __init__(self, obj: float | int | str | "DBig") -> None: ...
def unwrap(self) -> object: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
def __add__(self, other: Number) -> DBig: ...
def __radd__(self, other: Number) -> DBig: ...
def __sub__(self, other: Number) -> DBig: ...
def __rsub__(self, other: Number) -> DBig: ...
def __mul__(self, other: Number) -> DBig: ...
def __rmul__(self, other: Number) -> DBig: ...
def __truediv__(self, other: Number) -> DBig: ...
def __rtruediv__(self, other: Number) -> DBig: ...
def __mod__(self, other: Number) -> DBig: ...
def __rmod__(self, other: Number) -> DBig: ...
def __neg__(self) -> DBig: ...
def __pos__(self) -> DBig: ...
def __abs__(self) -> DBig: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: Number) -> bool: ...
def __le__(self, other: Number) -> bool: ...
def __gt__(self, other: Number) -> bool: ...
def __ge__(self, other: Number) -> bool: ...
def is_zero(self) -> bool: ...
def is_finite(self) -> bool: ...
def is_infinite(self) -> bool: ...
def sign(self) -> Sign: ...
def trunc(self) -> DBig: ...
def floor(self) -> DBig: ...
def ceil(self) -> DBig: ...
def round(self) -> DBig: ...
def fract(self) -> DBig: ...
def precision(self) -> int: ...
def digits(self) -> int: ...
def with_precision(self, precision: int) -> DBig: ...
@staticmethod
def from_parts(significand: int | IBig, exponent: int) -> DBig: ...
def to_int(self) -> IBig: ...
def to_decimal(self) -> DBig: ...
def to_binary(self) -> FBig: ...
def to_rational(self) -> RBig: ...
# transcendentals (same set as FBig)
def sin(self) -> DBig: ...
def cos(self) -> DBig: ...
def tan(self) -> DBig: ...
def asin(self) -> DBig: ...
def acos(self) -> DBig: ...
def atan(self) -> DBig: ...
def atan2(self, x: float | int | DBig) -> DBig: ...
def sinh(self) -> DBig: ...
def cosh(self) -> DBig: ...
def tanh(self) -> DBig: ...
def asinh(self) -> DBig: ...
def acosh(self) -> DBig: ...
def atanh(self) -> DBig: ...
def exp(self) -> DBig: ...
def exp_m1(self) -> DBig: ...
def ln(self) -> DBig: ...
def ln_1p(self) -> DBig: ...
def sqrt(self) -> DBig: ...
def cbrt(self) -> DBig: ...
def nth_root(self, n: int) -> DBig: ...
def powf(self, w: float | int | DBig) -> DBig: ...
def powi(self, n: int | IBig) -> DBig: ...
class RBig:
def __init__(self, obj: int | float | str | "RBig") -> None: ...
def unwrap(self) -> object: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
def __add__(self, other: Number) -> RBig: ...
def __radd__(self, other: Number) -> RBig: ...
def __sub__(self, other: Number) -> RBig: ...
def __rsub__(self, other: Number) -> RBig: ...
def __mul__(self, other: Number) -> RBig: ...
def __rmul__(self, other: Number) -> RBig: ...
def __truediv__(self, other: Number) -> RBig: ...
def __rtruediv__(self, other: Number) -> RBig: ...
def __mod__(self, other: Number) -> RBig: ...
def __rmod__(self, other: Number) -> RBig: ...
def __neg__(self) -> RBig: ...
def __pos__(self) -> RBig: ...
def __abs__(self) -> RBig: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __lt__(self, other: Number) -> bool: ...
def __le__(self, other: Number) -> bool: ...
def __gt__(self, other: Number) -> bool: ...
def __ge__(self, other: Number) -> bool: ...
@property
def numerator(self) -> IBig: ...
@property
def denominator(self) -> UBig: ...
def is_int(self) -> bool: ...
def is_one(self) -> bool: ...
def sign(self) -> Sign: ...
def signum(self) -> RBig: ...
def trunc(self) -> IBig: ...
def floor(self) -> IBig: ...
def ceil(self) -> IBig: ...
def round(self) -> IBig: ...
def fract(self) -> RBig: ...
def split_at_point(self) -> tuple[IBig, RBig]: ...
def sqr(self) -> RBig: ...
def cubic(self) -> RBig: ...
def pow(self, n: int) -> RBig: ...
def to_int(self) -> IBig: ...
def to_float(self, precision: int) -> FBig: ...
def to_decimal(self, precision: int) -> DBig: ...
@staticmethod
def from_parts(numerator: int | IBig, denominator: int | UBig) -> RBig: ...
@staticmethod
def simplest_from_float(f: float | int | FBig) -> Optional[RBig]: ...
class CBig:
def __init__(
self, re: float | int | str | FBig | "CBig" | complex, im: Optional[float | int | FBig] = ...
) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __bool__(self) -> bool: ...
def __complex__(self) -> complex: ...
def __add__(self, other: float | int | FBig | CBig | complex) -> CBig: ...
def __radd__(self, other: float | int | FBig | complex) -> CBig: ...
def __sub__(self, other: float | int | FBig | CBig | complex) -> CBig: ...
def __rsub__(self, other: float | int | FBig | complex) -> CBig: ...
def __mul__(self, other: float | int | FBig | CBig | complex) -> CBig: ...
def __rmul__(self, other: float | int | FBig | complex) -> CBig: ...
def __truediv__(self, other: float | int | FBig | CBig | complex) -> CBig: ...
def __rtruediv__(self, other: float | int | FBig | complex) -> CBig: ...
def __neg__(self) -> CBig: ...
def __pos__(self) -> CBig: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def real(self) -> FBig: ...
def imag(self) -> FBig: ...
def precision(self) -> int: ...
def is_zero(self) -> bool: ...
def is_finite(self) -> bool: ...
def is_infinite(self) -> bool: ...
def conj(self) -> CBig: ...
def proj(self) -> CBig: ...
def norm(self) -> FBig: ...
def abs(self) -> FBig: ...
def arg(self) -> FBig: ...
@staticmethod
def from_parts(re: FBig, im: FBig) -> CBig: ...
def sin(self) -> CBig: ...
def cos(self) -> CBig: ...
def tan(self) -> CBig: ...
def exp(self) -> CBig: ...
def ln(self) -> CBig: ...
def sqrt(self) -> CBig: ...
def powi(self, n: int | IBig) -> CBig: ...
def powf(self, w: CBig) -> CBig: ...
class Cache:
@staticmethod
def clear() -> None: ...
@staticmethod
def total_terms() -> int: ...
@staticmethod
def total_words() -> int: ...
# module-level math functions (transcendentals are panic-free; domain errors raise ValueError)
def auto(obj: Number) -> "UBig|IBig|FBig|DBig|RBig": ...
def autos(s: str) -> "UBig|IBig|FBig|DBig|RBig": ...
# default binary precision (bits) for FBig/CBig construction from float/complex;
# set_precision returns the previous value.
def get_precision() -> int: ...
def set_precision(precision: int) -> int: ...
def sin(x: Number) -> FBig: ...
def cos(x: Number) -> FBig: ...
def tan(x: Number) -> FBig: ...
def asin(x: Number) -> FBig: ...
def acos(x: Number) -> FBig: ...
def atan(x: Number) -> FBig: ...
def atan2(y: Number, x: Number) -> FBig: ...
def sinh(x: Number) -> FBig: ...
def cosh(x: Number) -> FBig: ...
def tanh(x: Number) -> FBig: ...
def asinh(x: Number) -> FBig: ...
def acosh(x: Number) -> FBig: ...
def atanh(x: Number) -> FBig: ...
def exp(x: Number) -> FBig: ...
def expm1(x: Number) -> FBig: ...
def log(x: Number) -> FBig: ...
def log1p(x: Number) -> FBig: ...
def ln(x: Number) -> FBig: ...
def ln_1p(x: Number) -> FBig: ...
def sqrt(x: Number) -> FBig: ...
def cbrt(x: Number) -> FBig: ...
def nth_root(x: Number, n: int) -> FBig: ...
def powf(x: Number, y: Number) -> FBig: ...
def powi(x: Number, n: int | IBig) -> FBig: ...
def hypot(x: Number, y: Number) -> FBig: ...
def gcd(a: int | UBig, b: int | UBig) -> UBig: ...
def gcd_ext(a: int | UBig, b: int | UBig) -> tuple[UBig, IBig, IBig]: ...
def lcm(a: int | UBig, b: int | UBig) -> UBig: ...