xref: /php-src/ext/gmp/gmp.stub.php (revision 4ea85d40)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var int
7 * @cvalue GMP_ROUND_ZERO
8 */
9const GMP_ROUND_ZERO = UNKNOWN;
10/**
11 * @var int
12 * @cvalue GMP_ROUND_PLUSINF
13 */
14const GMP_ROUND_PLUSINF = UNKNOWN;
15/**
16 * @var int
17 * @cvalue GMP_ROUND_MINUSINF
18 */
19const GMP_ROUND_MINUSINF = UNKNOWN;
20
21#ifdef mpir_version
22/**
23 * @var string
24 * @cvalue GMP_MPIR_VERSION_STRING
25 */
26const GMP_MPIR_VERSION = UNKNOWN;
27#endif
28/**
29 * @var string
30 * @cvalue GMP_VERSION_STRING
31 */
32const GMP_VERSION = UNKNOWN;
33
34/**
35 * @var int
36 * @cvalue GMP_MSW_FIRST
37 */
38const GMP_MSW_FIRST = UNKNOWN;
39/**
40 * @var int
41 * @cvalue GMP_LSW_FIRST
42 */
43const GMP_LSW_FIRST = UNKNOWN;
44/**
45 * @var int
46 * @cvalue GMP_LITTLE_ENDIAN
47 */
48const GMP_LITTLE_ENDIAN = UNKNOWN;
49/**
50 * @var int
51 * @cvalue GMP_BIG_ENDIAN
52 */
53const GMP_BIG_ENDIAN = UNKNOWN;
54/**
55 * @var int
56 * @cvalue GMP_NATIVE_ENDIAN
57 */
58const GMP_NATIVE_ENDIAN = UNKNOWN;
59
60class GMP
61{
62    public function __construct(int|string $num = 0, int $base = 0) {}
63
64    public function __serialize(): array {}
65
66    public function __unserialize(array $data): void {}
67}
68
69function gmp_init(int|string $num, int $base = 0): GMP {}
70
71function gmp_import(string $data, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {}
72
73function gmp_export(GMP|int|string $num, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {}
74
75function gmp_intval(GMP|int|string $num): int {}
76
77function gmp_strval(GMP|int|string $num, int $base = 10): string {}
78
79function gmp_add(GMP|int|string $num1, GMP|int|string $num2): GMP {}
80
81function gmp_sub(GMP|int|string $num1, GMP|int|string $num2): GMP {}
82
83function gmp_mul(GMP|int|string $num1, GMP|int|string $num2): GMP {}
84
85/**
86 * @return array<int, GMP>
87 * @refcount 1
88 */
89function gmp_div_qr(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): array {}
90
91function gmp_div_q(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
92
93function gmp_div_r(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
94
95/** @alias gmp_div_q */
96function gmp_div(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {}
97
98function gmp_mod(GMP|int|string $num1, GMP|int|string $num2): GMP {}
99
100function gmp_divexact(GMP|int|string $num1, GMP|int|string $num2): GMP {}
101
102function gmp_neg(GMP|int|string $num): GMP {}
103
104function gmp_abs(GMP|int|string $num): GMP {}
105
106function gmp_fact(GMP|int|string $num): GMP {}
107
108function gmp_sqrt(GMP|int|string $num): GMP {}
109
110/**
111 * @return array<int, GMP>
112 * @refcount 1
113 */
114function gmp_sqrtrem(GMP|int|string $num): array {}
115
116function gmp_root(GMP|int|string $num, int $nth): GMP {}
117
118/**
119 * @return array<int, GMP>
120 * @refcount 1
121 */
122function gmp_rootrem(GMP|int|string $num, int $nth): array {}
123
124function gmp_pow(GMP|int|string $num, int $exponent): GMP {}
125
126function gmp_powm(GMP|int|string $num, GMP|int|string $exponent, GMP|int|string $modulus): GMP {}
127
128function gmp_perfect_square(GMP|int|string $num): bool {}
129
130function gmp_perfect_power(GMP|int|string $num): bool {}
131
132function gmp_prob_prime(GMP|int|string $num, int $repetitions = 10): int {}
133
134function gmp_gcd(GMP|int|string $num1, GMP|int|string $num2): GMP {}
135
136/**
137 * @return array<string, GMP>
138 * @refcount 1
139 */
140function gmp_gcdext(GMP|int|string $num1, GMP|int|string $num2): array {}
141
142function gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMP {}
143
144function gmp_invert(GMP|int|string $num1, GMP|int|string $num2): GMP|false {}
145
146function gmp_jacobi(GMP|int|string $num1, GMP|int|string $num2): int {}
147
148function gmp_legendre(GMP|int|string $num1, GMP|int|string $num2): int {}
149
150function gmp_kronecker(GMP|int|string $num1, GMP|int|string $num2): int {}
151
152function gmp_cmp(GMP|int|string $num1, GMP|int|string $num2): int {}
153
154function gmp_sign(GMP|int|string $num): int {}
155
156function gmp_random_seed(GMP|int|string $seed): void {}
157
158function gmp_random_bits(int $bits): GMP {}
159
160function gmp_random_range(GMP|int|string $min, GMP|int|string $max): GMP {}
161
162function gmp_and(GMP|int|string $num1, GMP|int|string $num2): GMP {}
163
164function gmp_or(GMP|int|string $num1, GMP|int|string $num2): GMP {}
165
166function gmp_com(GMP|int|string $num): GMP {}
167
168function gmp_xor(GMP|int|string $num1, GMP|int|string $num2): GMP {}
169
170function gmp_setbit(GMP $num, int $index, bool $value = true): void {}
171
172function gmp_clrbit(GMP $num, int $index): void {}
173
174function gmp_testbit(GMP|int|string $num, int $index): bool {}
175
176function gmp_scan0(GMP|int|string $num1, int $start): int {}
177
178function gmp_scan1(GMP|int|string $num1, int $start): int {}
179
180function gmp_popcount(GMP|int|string $num): int {}
181
182function gmp_hamdist(GMP|int|string $num1, GMP|int|string $num2): int {}
183
184function gmp_nextprime(GMP|int|string $num): GMP {}
185
186function gmp_binomial(GMP|int|string $n, int $k): GMP {}
187