1--TEST--
2bcmod() function with large numbers
3--EXTENSIONS--
4bcmath
5--INI--
6bcmath.scale=0
7--FILE--
8<?php
9require(__DIR__ . "/run_bcmath_tests_function.inc");
10
11$dividends = [
12    "15151324141414.412312232141241",
13    "-132132245132134.1515123765412",
14    "141241241241241248267654747412",
15    "-149143276547656984948124912",
16    "0.1322135476547459213732911312",
17    "-0.123912932193769965476541321",
18];
19$divisors = array_merge($dividends, [
20    "15",
21    "-15",
22    "1",
23    "-9",
24    "14.14",
25    "-16.60",
26    "0.15",
27    "-0.01",
28]);
29
30run_bcmath_tests($dividends, $divisors, "mod", bcmod(...));
31
32?>
33--EXPECT--
34Number "15151324141414.412312232141241" (scale 0)
3515151324141414.412312232141241 mod 15151324141414.412312232141241 = 0
3615151324141414.412312232141241 mod -132132245132134.1515123765412 = 15151324141414
3715151324141414.412312232141241 mod 141241241241241248267654747412 = 15151324141414
3815151324141414.412312232141241 mod -149143276547656984948124912   = 15151324141414
3915151324141414.412312232141241 mod 0.1322135476547459213732911312 = 0
4015151324141414.412312232141241 mod -0.123912932193769965476541321 = 0
4115151324141414.412312232141241 mod 15                             = 4
4215151324141414.412312232141241 mod -15                            = 4
4315151324141414.412312232141241 mod 1                              = 0
4415151324141414.412312232141241 mod -9                             = 1
4515151324141414.412312232141241 mod 14.14                          = 5
4615151324141414.412312232141241 mod -16.60                         = 12
4715151324141414.412312232141241 mod 0.15                           = 0
4815151324141414.412312232141241 mod -0.01                          = 0
49
50Number "-132132245132134.1515123765412" (scale 0)
51-132132245132134.1515123765412 mod 15151324141414.412312232141241 = -10921652000818
52-132132245132134.1515123765412 mod -132132245132134.1515123765412 = 0
53-132132245132134.1515123765412 mod 141241241241241248267654747412 = -132132245132134
54-132132245132134.1515123765412 mod -149143276547656984948124912   = -132132245132134
55-132132245132134.1515123765412 mod 0.1322135476547459213732911312 = 0
56-132132245132134.1515123765412 mod -0.123912932193769965476541321 = 0
57-132132245132134.1515123765412 mod 15                             = -4
58-132132245132134.1515123765412 mod -15                            = -4
59-132132245132134.1515123765412 mod 1                              = 0
60-132132245132134.1515123765412 mod -9                             = -1
61-132132245132134.1515123765412 mod 14.14                          = -13
62-132132245132134.1515123765412 mod -16.60                         = -10
63-132132245132134.1515123765412 mod 0.15                           = 0
64-132132245132134.1515123765412 mod -0.01                          = 0
65
66Number "141241241241241248267654747412" (scale 0)
67141241241241241248267654747412 mod 15151324141414.412312232141241 = 8686992633814
68141241241241241248267654747412 mod -132132245132134.1515123765412 = 123972365443639
69141241241241241248267654747412 mod 141241241241241248267654747412 = 0
70141241241241241248267654747412 mod -149143276547656984948124912   = 2558350610083521780455748
71141241241241241248267654747412 mod 0.1322135476547459213732911312 = 0
72141241241241241248267654747412 mod -0.123912932193769965476541321 = 0
73141241241241241248267654747412 mod 15                             = 7
74141241241241241248267654747412 mod -15                            = 7
75141241241241241248267654747412 mod 1                              = 0
76141241241241241248267654747412 mod -9                             = 4
77141241241241241248267654747412 mod 14.14                          = 3
78141241241241241248267654747412 mod -16.60                         = 16
79141241241241241248267654747412 mod 0.15                           = 0
80141241241241241248267654747412 mod -0.01                          = 0
81
82Number "-149143276547656984948124912" (scale 0)
83-149143276547656984948124912 mod 15151324141414.412312232141241 = -6434701710093
84-149143276547656984948124912 mod -132132245132134.1515123765412 = -44045918171152
85-149143276547656984948124912 mod 141241241241241248267654747412 = -149143276547656984948124912
86-149143276547656984948124912 mod -149143276547656984948124912   = 0
87-149143276547656984948124912 mod 0.1322135476547459213732911312 = 0
88-149143276547656984948124912 mod -0.123912932193769965476541321 = 0
89-149143276547656984948124912 mod 15                             = -2
90-149143276547656984948124912 mod -15                            = -2
91-149143276547656984948124912 mod 1                              = 0
92-149143276547656984948124912 mod -9                             = -5
93-149143276547656984948124912 mod 14.14                          = -7
94-149143276547656984948124912 mod -16.60                         = -13
95-149143276547656984948124912 mod 0.15                           = 0
96-149143276547656984948124912 mod -0.01                          = 0
97
98Number "0.1322135476547459213732911312" (scale 0)
990.1322135476547459213732911312 mod 15151324141414.412312232141241 = 0
1000.1322135476547459213732911312 mod -132132245132134.1515123765412 = 0
1010.1322135476547459213732911312 mod 141241241241241248267654747412 = 0
1020.1322135476547459213732911312 mod -149143276547656984948124912   = 0
1030.1322135476547459213732911312 mod 0.1322135476547459213732911312 = 0
1040.1322135476547459213732911312 mod -0.123912932193769965476541321 = 0
1050.1322135476547459213732911312 mod 15                             = 0
1060.1322135476547459213732911312 mod -15                            = 0
1070.1322135476547459213732911312 mod 1                              = 0
1080.1322135476547459213732911312 mod -9                             = 0
1090.1322135476547459213732911312 mod 14.14                          = 0
1100.1322135476547459213732911312 mod -16.60                         = 0
1110.1322135476547459213732911312 mod 0.15                           = 0
1120.1322135476547459213732911312 mod -0.01                          = 0
113
114Number "-0.123912932193769965476541321" (scale 0)
115-0.123912932193769965476541321 mod 15151324141414.412312232141241 = 0
116-0.123912932193769965476541321 mod -132132245132134.1515123765412 = 0
117-0.123912932193769965476541321 mod 141241241241241248267654747412 = 0
118-0.123912932193769965476541321 mod -149143276547656984948124912   = 0
119-0.123912932193769965476541321 mod 0.1322135476547459213732911312 = 0
120-0.123912932193769965476541321 mod -0.123912932193769965476541321 = 0
121-0.123912932193769965476541321 mod 15                             = 0
122-0.123912932193769965476541321 mod -15                            = 0
123-0.123912932193769965476541321 mod 1                              = 0
124-0.123912932193769965476541321 mod -9                             = 0
125-0.123912932193769965476541321 mod 14.14                          = 0
126-0.123912932193769965476541321 mod -16.60                         = 0
127-0.123912932193769965476541321 mod 0.15                           = 0
128-0.123912932193769965476541321 mod -0.01                          = 0
129
130Number "15151324141414.412312232141241" (scale 10)
13115151324141414.412312232141241 mod 15151324141414.412312232141241 = 0.0000000000
13215151324141414.412312232141241 mod -132132245132134.1515123765412 = 15151324141414.4123122321
13315151324141414.412312232141241 mod 141241241241241248267654747412 = 15151324141414.4123122321
13415151324141414.412312232141241 mod -149143276547656984948124912   = 15151324141414.4123122321
13515151324141414.412312232141241 mod 0.1322135476547459213732911312 = 0.0655398311
13615151324141414.412312232141241 mod -0.123912932193769965476541321 = 0.0095762801
13715151324141414.412312232141241 mod 15                             = 4.4123122321
13815151324141414.412312232141241 mod -15                            = 4.4123122321
13915151324141414.412312232141241 mod 1                              = 0.4123122321
14015151324141414.412312232141241 mod -9                             = 1.4123122321
14115151324141414.412312232141241 mod 14.14                          = 5.4323122321
14215151324141414.412312232141241 mod -16.60                         = 12.0123122321
14315151324141414.412312232141241 mod 0.15                           = 0.0623122321
14415151324141414.412312232141241 mod -0.01                          = 0.0023122321
145
146Number "-132132245132134.1515123765412" (scale 10)
147-132132245132134.1515123765412 mod 15151324141414.412312232141241 = -10921652000818.8530145194
148-132132245132134.1515123765412 mod -132132245132134.1515123765412 = 0.0000000000
149-132132245132134.1515123765412 mod 141241241241241248267654747412 = -132132245132134.1515123765
150-132132245132134.1515123765412 mod -149143276547656984948124912   = -132132245132134.1515123765
151-132132245132134.1515123765412 mod 0.1322135476547459213732911312 = -0.1182110375
152-132132245132134.1515123765412 mod -0.123912932193769965476541321 = -0.1185620881
153-132132245132134.1515123765412 mod 15                             = -4.1515123765
154-132132245132134.1515123765412 mod -15                            = -4.1515123765
155-132132245132134.1515123765412 mod 1                              = -0.1515123765
156-132132245132134.1515123765412 mod -9                             = -1.1515123765
157-132132245132134.1515123765412 mod 14.14                          = -13.0715123765
158-132132245132134.1515123765412 mod -16.60                         = -10.1515123765
159-132132245132134.1515123765412 mod 0.15                           = -0.1015123765
160-132132245132134.1515123765412 mod -0.01                          = -0.0015123765
161
162Number "141241241241241248267654747412" (scale 10)
163141241241241241248267654747412 mod 15151324141414.412312232141241 = 8686992633814.2424625456
164141241241241241248267654747412 mod -132132245132134.1515123765412 = 123972365443639.7631318878
165141241241241241248267654747412 mod 141241241241241248267654747412 = 0.0000000000
166141241241241241248267654747412 mod -149143276547656984948124912   = 2558350610083521780455748.0000000000
167141241241241241248267654747412 mod 0.1322135476547459213732911312 = 0.0325300077
168141241241241241248267654747412 mod -0.123912932193769965476541321 = 0.0711933134
169141241241241241248267654747412 mod 15                             = 7.0000000000
170141241241241241248267654747412 mod -15                            = 7.0000000000
171141241241241241248267654747412 mod 1                              = 0.0000000000
172141241241241241248267654747412 mod -9                             = 4.0000000000
173141241241241241248267654747412 mod 14.14                          = 3.4600000000
174141241241241241248267654747412 mod -16.60                         = 16.4000000000
175141241241241241248267654747412 mod 0.15                           = 0.1000000000
176141241241241241248267654747412 mod -0.01                          = 0.0000000000
177
178Number "-149143276547656984948124912" (scale 10)
179-149143276547656984948124912 mod 15151324141414.412312232141241 = -6434701710093.8435198341
180-149143276547656984948124912 mod -132132245132134.1515123765412 = -44045918171152.5846031960
181-149143276547656984948124912 mod 141241241241241248267654747412 = -149143276547656984948124912.0000000000
182-149143276547656984948124912 mod -149143276547656984948124912   = 0.0000000000
183-149143276547656984948124912 mod 0.1322135476547459213732911312 = -0.0321624457
184-149143276547656984948124912 mod -0.123912932193769965476541321 = -0.0895308287
185-149143276547656984948124912 mod 15                             = -2.0000000000
186-149143276547656984948124912 mod -15                            = -2.0000000000
187-149143276547656984948124912 mod 1                              = 0.0000000000
188-149143276547656984948124912 mod -9                             = -5.0000000000
189-149143276547656984948124912 mod 14.14                          = -7.0400000000
190-149143276547656984948124912 mod -16.60                         = -13.8000000000
191-149143276547656984948124912 mod 0.15                           = -0.0500000000
192-149143276547656984948124912 mod -0.01                          = 0.0000000000
193
194Number "0.1322135476547459213732911312" (scale 10)
1950.1322135476547459213732911312 mod 15151324141414.412312232141241 = 0.1322135476
1960.1322135476547459213732911312 mod -132132245132134.1515123765412 = 0.1322135476
1970.1322135476547459213732911312 mod 141241241241241248267654747412 = 0.1322135476
1980.1322135476547459213732911312 mod -149143276547656984948124912   = 0.1322135476
1990.1322135476547459213732911312 mod 0.1322135476547459213732911312 = 0.0000000000
2000.1322135476547459213732911312 mod -0.123912932193769965476541321 = 0.0083006154
2010.1322135476547459213732911312 mod 15                             = 0.1322135476
2020.1322135476547459213732911312 mod -15                            = 0.1322135476
2030.1322135476547459213732911312 mod 1                              = 0.1322135476
2040.1322135476547459213732911312 mod -9                             = 0.1322135476
2050.1322135476547459213732911312 mod 14.14                          = 0.1322135476
2060.1322135476547459213732911312 mod -16.60                         = 0.1322135476
2070.1322135476547459213732911312 mod 0.15                           = 0.1322135476
2080.1322135476547459213732911312 mod -0.01                          = 0.0022135476
209
210Number "-0.123912932193769965476541321" (scale 10)
211-0.123912932193769965476541321 mod 15151324141414.412312232141241 = -0.1239129321
212-0.123912932193769965476541321 mod -132132245132134.1515123765412 = -0.1239129321
213-0.123912932193769965476541321 mod 141241241241241248267654747412 = -0.1239129321
214-0.123912932193769965476541321 mod -149143276547656984948124912   = -0.1239129321
215-0.123912932193769965476541321 mod 0.1322135476547459213732911312 = -0.1239129321
216-0.123912932193769965476541321 mod -0.123912932193769965476541321 = 0.0000000000
217-0.123912932193769965476541321 mod 15                             = -0.1239129321
218-0.123912932193769965476541321 mod -15                            = -0.1239129321
219-0.123912932193769965476541321 mod 1                              = -0.1239129321
220-0.123912932193769965476541321 mod -9                             = -0.1239129321
221-0.123912932193769965476541321 mod 14.14                          = -0.1239129321
222-0.123912932193769965476541321 mod -16.60                         = -0.1239129321
223-0.123912932193769965476541321 mod 0.15                           = -0.1239129321
224-0.123912932193769965476541321 mod -0.01                          = -0.0039129321
225