1--TEST--
2bcmul() 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$firstFactors = [
12    "15151324141414.412312232141241",
13    "-132132245132134.1515123765412",
14    "141241241241241248267654747412",
15    "-149143276547656984948124912",
16    "0.1322135476547459213732911312",
17    "-0.123912932193769965476541321",
18];
19$secondFactors = array_merge($firstFactors, [
20    "0",
21    "0.00",
22    "-0",
23    "-0.00",
24    "15",
25    "-15",
26    "1",
27    "-9",
28    "14.14",
29    "-16.60",
30    "0.15",
31    "-0.01",
32]);
33
34run_bcmath_tests($firstFactors, $secondFactors, "*", bcmul(...));
35
36?>
37--EXPECT--
38Number "15151324141414.412312232141241" (scale 0)
3915151324141414.412312232141241 * 15151324141414.412312232141241 = 229562623238207178422472679
4015151324141414.412312232141241 * -132132245132134.1515123765412 = -2001978475529791133885654151
4115151324141414.412312232141241 * 141241241241241248267654747412 = 2139991828181755439048012256383179795538025
4215151324141414.412312232141241 * -149143276547656984948124912   = -2259718126486161223119790826488981524974
4315151324141414.412312232141241 * 0.1322135476547459213732911312 = 2003210316403
4415151324141414.412312232141241 * -0.123912932193769965476541321 = -1877445000980
4515151324141414.412312232141241 * 0                              = 0
4615151324141414.412312232141241 * 0.00                           = 0
4715151324141414.412312232141241 * -0                             = 0
4815151324141414.412312232141241 * -0.00                          = 0
4915151324141414.412312232141241 * 15                             = 227269862121216
5015151324141414.412312232141241 * -15                            = -227269862121216
5115151324141414.412312232141241 * 1                              = 15151324141414
5215151324141414.412312232141241 * -9                             = -136361917272729
5315151324141414.412312232141241 * 14.14                          = 214239723359599
5415151324141414.412312232141241 * -16.60                         = -251511980747479
5515151324141414.412312232141241 * 0.15                           = 2272698621212
5615151324141414.412312232141241 * -0.01                          = -151513241414
57
58Number "-132132245132134.1515123765412" (scale 0)
59-132132245132134.1515123765412 * 15151324141414.412312232141241 = -2001978475529791133885654151
60-132132245132134.1515123765412 * -132132245132134.1515123765412 = 17458930203658389178460349344
61-132132245132134.1515123765412 * 141241241241241248267654747412 = -18662522310454584290173879848464266332555498
62-132132245132134.1515123765412 * -149143276547656984948124912   = 19706635976604687211527336089051267200810
63-132132245132134.1515123765412 * 0.1322135476547459213732911312 = -17469672888505
64-132132245132134.1515123765412 * -0.123912932193769965476541321 = 16372893931668
65-132132245132134.1515123765412 * 0                              = 0
66-132132245132134.1515123765412 * 0.00                           = 0
67-132132245132134.1515123765412 * -0                             = 0
68-132132245132134.1515123765412 * -0.00                          = 0
69-132132245132134.1515123765412 * 15                             = -1981983676982012
70-132132245132134.1515123765412 * -15                            = 1981983676982012
71-132132245132134.1515123765412 * 1                              = -132132245132134
72-132132245132134.1515123765412 * -9                             = 1189190206189207
73-132132245132134.1515123765412 * 14.14                          = -1868349946168376
74-132132245132134.1515123765412 * -16.60                         = 2193395269193426
75-132132245132134.1515123765412 * 0.15                           = -19819836769820
76-132132245132134.1515123765412 * -0.01                          = 1321322451321
77
78Number "141241241241241248267654747412" (scale 0)
79141241241241241248267654747412 * 15151324141414.412312232141241 = 2139991828181755439048012256383179795538025
80141241241241241248267654747412 * -132132245132134.1515123765412 = -18662522310454584290173879848464266332555498
81141241241241241248267654747412 * 141241241241241248267654747412 = 19949088227366507629622653233761071253230364164181520697744
82141241241241241248267654747412 * -149143276547656984948124912   = -21065181502376778401476291731259854717478035244384727744
83141241241241241248267654747412 * 0.1322135476547459213732911312 = 18674005579664314748578026521
84141241241241241248267654747412 * -0.123912932193769965476541321 = -17501616348889832831364181429
85141241241241241248267654747412 * 0                              = 0
86141241241241241248267654747412 * 0.00                           = 0
87141241241241241248267654747412 * -0                             = 0
88141241241241241248267654747412 * -0.00                          = 0
89141241241241241248267654747412 * 15                             = 2118618618618618724014821211180
90141241241241241248267654747412 * -15                            = -2118618618618618724014821211180
91141241241241241248267654747412 * 1                              = 141241241241241248267654747412
92141241241241241248267654747412 * -9                             = -1271171171171171234408892726708
93141241241241241248267654747412 * 14.14                          = 1997151151151151250504638128405
94141241241241241248267654747412 * -16.60                         = -2344604604604604721243068807039
95141241241241241248267654747412 * 0.15                           = 21186186186186187240148212111
96141241241241241248267654747412 * -0.01                          = -1412412412412412482676547474
97
98Number "-149143276547656984948124912" (scale 0)
99-149143276547656984948124912 * 15151324141414.412312232141241 = -2259718126486161223119790826488981524974
100-149143276547656984948124912 * -132132245132134.1515123765412 = 19706635976604687211527336089051267200810
101-149143276547656984948124912 * 141241241241241248267654747412 = -21065181502376778401476291731259854717478035244384727744
102-149143276547656984948124912 * -149143276547656984948124912   = 22243716939370890018820252028254140421311664755007744
103-149143276547656984948124912 * 0.1322135476547459213732911312 = -19718761701218596539144441
104-149143276547656984948124912 * -0.123912932193769965476541321 = 18480780714006502282899774
105-149143276547656984948124912 * 0                              = 0
106-149143276547656984948124912 * 0.00                           = 0
107-149143276547656984948124912 * -0                             = 0
108-149143276547656984948124912 * -0.00                          = 0
109-149143276547656984948124912 * 15                             = -2237149148214854774221873680
110-149143276547656984948124912 * -15                            = 2237149148214854774221873680
111-149143276547656984948124912 * 1                              = -149143276547656984948124912
112-149143276547656984948124912 * -9                             = 1342289488928912864533124208
113-149143276547656984948124912 * 14.14                          = -2108885930383869767166486255
114-149143276547656984948124912 * -16.60                         = 2475778390691105950138873539
115-149143276547656984948124912 * 0.15                           = -22371491482148547742218736
116-149143276547656984948124912 * -0.01                          = 1491432765476569849481249
117
118Number "0.1322135476547459213732911312" (scale 0)
1190.1322135476547459213732911312 * 15151324141414.412312232141241 = 2003210316403
1200.1322135476547459213732911312 * -132132245132134.1515123765412 = -17469672888505
1210.1322135476547459213732911312 * 141241241241241248267654747412 = 18674005579664314748578026521
1220.1322135476547459213732911312 * -149143276547656984948124912   = -19718761701218596539144441
1230.1322135476547459213732911312 * 0.1322135476547459213732911312 = 0
1240.1322135476547459213732911312 * -0.123912932193769965476541321 = 0
1250.1322135476547459213732911312 * 0                              = 0
1260.1322135476547459213732911312 * 0.00                           = 0
1270.1322135476547459213732911312 * -0                             = 0
1280.1322135476547459213732911312 * -0.00                          = 0
1290.1322135476547459213732911312 * 15                             = 1
1300.1322135476547459213732911312 * -15                            = -1
1310.1322135476547459213732911312 * 1                              = 0
1320.1322135476547459213732911312 * -9                             = -1
1330.1322135476547459213732911312 * 14.14                          = 1
1340.1322135476547459213732911312 * -16.60                         = -2
1350.1322135476547459213732911312 * 0.15                           = 0
1360.1322135476547459213732911312 * -0.01                          = 0
137
138Number "-0.123912932193769965476541321" (scale 0)
139-0.123912932193769965476541321 * 15151324141414.412312232141241 = -1877445000980
140-0.123912932193769965476541321 * -132132245132134.1515123765412 = 16372893931668
141-0.123912932193769965476541321 * 141241241241241248267654747412 = -17501616348889832831364181429
142-0.123912932193769965476541321 * -149143276547656984948124912   = 18480780714006502282899774
143-0.123912932193769965476541321 * 0.1322135476547459213732911312 = 0
144-0.123912932193769965476541321 * -0.123912932193769965476541321 = 0
145-0.123912932193769965476541321 * 0                              = 0
146-0.123912932193769965476541321 * 0.00                           = 0
147-0.123912932193769965476541321 * -0                             = 0
148-0.123912932193769965476541321 * -0.00                          = 0
149-0.123912932193769965476541321 * 15                             = -1
150-0.123912932193769965476541321 * -15                            = 1
151-0.123912932193769965476541321 * 1                              = 0
152-0.123912932193769965476541321 * -9                             = 1
153-0.123912932193769965476541321 * 14.14                          = -1
154-0.123912932193769965476541321 * -16.60                         = 2
155-0.123912932193769965476541321 * 0.15                           = 0
156-0.123912932193769965476541321 * -0.01                          = 0
157
158Number "15151324141414.412312232141241" (scale 10)
15915151324141414.412312232141241 * 15151324141414.412312232141241 = 229562623238207178422472679.9262995876
16015151324141414.412312232141241 * -132132245132134.1515123765412 = -2001978475529791133885654151.5491331991
16115151324141414.412312232141241 * 141241241241241248267654747412 = 2139991828181755439048012256383179795538025.4097677632
16215151324141414.412312232141241 * -149143276547656984948124912   = -2259718126486161223119790826488981524974.8925816946
16315151324141414.412312232141241 * 0.1322135476547459213732911312 = 2003210316403.3967337164
16415151324141414.412312232141241 * -0.123912932193769965476541321 = -1877445000980.9140124713
16515151324141414.412312232141241 * 0                              = 0.0000000000
16615151324141414.412312232141241 * 0.00                           = 0.0000000000
16715151324141414.412312232141241 * -0                             = 0.0000000000
16815151324141414.412312232141241 * -0.00                          = 0.0000000000
16915151324141414.412312232141241 * 15                             = 227269862121216.1846834821
17015151324141414.412312232141241 * -15                            = -227269862121216.1846834821
17115151324141414.412312232141241 * 1                              = 15151324141414.4123122321
17215151324141414.412312232141241 * -9                             = -136361917272729.7108100892
17315151324141414.412312232141241 * 14.14                          = 214239723359599.7900949624
17415151324141414.412312232141241 * -16.60                         = -251511980747479.2443830535
17515151324141414.412312232141241 * 0.15                           = 2272698621212.1618468348
17615151324141414.412312232141241 * -0.01                          = -151513241414.1441231223
177
178Number "-132132245132134.1515123765412" (scale 10)
179-132132245132134.1515123765412 * 15151324141414.412312232141241 = -2001978475529791133885654151.5491331991
180-132132245132134.1515123765412 * -132132245132134.1515123765412 = 17458930203658389178460349344.0776677900
181-132132245132134.1515123765412 * 141241241241241248267654747412 = -18662522310454584290173879848464266332555498.5267202113
182-132132245132134.1515123765412 * -149143276547656984948124912   = 19706635976604687211527336089051267200810.4158361143
183-132132245132134.1515123765412 * 0.1322135476547459213732911312 = -17469672888505.9884334474
184-132132245132134.1515123765412 * -0.123912932193769965476541321 = 16372893931668.7307088223
185-132132245132134.1515123765412 * 0                              = 0.0000000000
186-132132245132134.1515123765412 * 0.00                           = 0.0000000000
187-132132245132134.1515123765412 * -0                             = 0.0000000000
188-132132245132134.1515123765412 * -0.00                          = 0.0000000000
189-132132245132134.1515123765412 * 15                             = -1981983676982012.2726856481
190-132132245132134.1515123765412 * -15                            = 1981983676982012.2726856481
191-132132245132134.1515123765412 * 1                              = -132132245132134.1515123765
192-132132245132134.1515123765412 * -9                             = 1189190206189207.3636113888
193-132132245132134.1515123765412 * 14.14                          = -1868349946168376.9023850042
194-132132245132134.1515123765412 * -16.60                         = 2193395269193426.9151054505
195-132132245132134.1515123765412 * 0.15                           = -19819836769820.1227268564
196-132132245132134.1515123765412 * -0.01                          = 1321322451321.3415151237
197
198Number "141241241241241248267654747412" (scale 10)
199141241241241241248267654747412 * 15151324141414.412312232141241 = 2139991828181755439048012256383179795538025.4097677632
200141241241241241248267654747412 * -132132245132134.1515123765412 = -18662522310454584290173879848464266332555498.5267202113
201141241241241241248267654747412 * 141241241241241248267654747412 = 19949088227366507629622653233761071253230364164181520697744.0000000000
202141241241241241248267654747412 * -149143276547656984948124912   = -21065181502376778401476291731259854717478035244384727744.0000000000
203141241241241241248267654747412 * 0.1322135476547459213732911312 = 18674005579664314748578026521.9598901262
204141241241241241248267654747412 * -0.123912932193769965476541321 = -17501616348889832831364181429.7008871512
205141241241241241248267654747412 * 0                              = 0.0000000000
206141241241241241248267654747412 * 0.00                           = 0.0000000000
207141241241241241248267654747412 * -0                             = 0.0000000000
208141241241241241248267654747412 * -0.00                          = 0.0000000000
209141241241241241248267654747412 * 15                             = 2118618618618618724014821211180.0000000000
210141241241241241248267654747412 * -15                            = -2118618618618618724014821211180.0000000000
211141241241241241248267654747412 * 1                              = 141241241241241248267654747412.0000000000
212141241241241241248267654747412 * -9                             = -1271171171171171234408892726708.0000000000
213141241241241241248267654747412 * 14.14                          = 1997151151151151250504638128405.6800000000
214141241241241241248267654747412 * -16.60                         = -2344604604604604721243068807039.2000000000
215141241241241241248267654747412 * 0.15                           = 21186186186186187240148212111.8000000000
216141241241241241248267654747412 * -0.01                          = -1412412412412412482676547474.1200000000
217
218Number "-149143276547656984948124912" (scale 10)
219-149143276547656984948124912 * 15151324141414.412312232141241 = -2259718126486161223119790826488981524974.8925816946
220-149143276547656984948124912 * -132132245132134.1515123765412 = 19706635976604687211527336089051267200810.4158361143
221-149143276547656984948124912 * 141241241241241248267654747412 = -21065181502376778401476291731259854717478035244384727744.0000000000
222-149143276547656984948124912 * -149143276547656984948124912   = 22243716939370890018820252028254140421311664755007744.0000000000
223-149143276547656984948124912 * 0.1322135476547459213732911312 = -19718761701218596539144441.0298753533
224-149143276547656984948124912 * -0.123912932193769965476541321 = 18480780714006502282899774.5778544540
225-149143276547656984948124912 * 0                              = 0.0000000000
226-149143276547656984948124912 * 0.00                           = 0.0000000000
227-149143276547656984948124912 * -0                             = 0.0000000000
228-149143276547656984948124912 * -0.00                          = 0.0000000000
229-149143276547656984948124912 * 15                             = -2237149148214854774221873680.0000000000
230-149143276547656984948124912 * -15                            = 2237149148214854774221873680.0000000000
231-149143276547656984948124912 * 1                              = -149143276547656984948124912.0000000000
232-149143276547656984948124912 * -9                             = 1342289488928912864533124208.0000000000
233-149143276547656984948124912 * 14.14                          = -2108885930383869767166486255.6800000000
234-149143276547656984948124912 * -16.60                         = 2475778390691105950138873539.2000000000
235-149143276547656984948124912 * 0.15                           = -22371491482148547742218736.8000000000
236-149143276547656984948124912 * -0.01                          = 1491432765476569849481249.1200000000
237
238Number "0.1322135476547459213732911312" (scale 10)
2390.1322135476547459213732911312 * 15151324141414.412312232141241 = 2003210316403.3967337164
2400.1322135476547459213732911312 * -132132245132134.1515123765412 = -17469672888505.9884334474
2410.1322135476547459213732911312 * 141241241241241248267654747412 = 18674005579664314748578026521.9598901262
2420.1322135476547459213732911312 * -149143276547656984948124912   = -19718761701218596539144441.0298753533
2430.1322135476547459213732911312 * 0.1322135476547459213732911312 = 0.0174804221
2440.1322135476547459213732911312 * -0.123912932193769965476541321 = -0.0163829683
2450.1322135476547459213732911312 * 0                              = 0.0000000000
2460.1322135476547459213732911312 * 0.00                           = 0.0000000000
2470.1322135476547459213732911312 * -0                             = 0.0000000000
2480.1322135476547459213732911312 * -0.00                          = 0.0000000000
2490.1322135476547459213732911312 * 15                             = 1.9832032148
2500.1322135476547459213732911312 * -15                            = -1.9832032148
2510.1322135476547459213732911312 * 1                              = 0.1322135476
2520.1322135476547459213732911312 * -9                             = -1.1899219288
2530.1322135476547459213732911312 * 14.14                          = 1.8694995638
2540.1322135476547459213732911312 * -16.60                         = -2.1947448910
2550.1322135476547459213732911312 * 0.15                           = 0.0198320321
2560.1322135476547459213732911312 * -0.01                          = -0.0013221354
257
258Number "-0.123912932193769965476541321" (scale 10)
259-0.123912932193769965476541321 * 15151324141414.412312232141241 = -1877445000980.9140124713
260-0.123912932193769965476541321 * -132132245132134.1515123765412 = 16372893931668.7307088223
261-0.123912932193769965476541321 * 141241241241241248267654747412 = -17501616348889832831364181429.7008871512
262-0.123912932193769965476541321 * -149143276547656984948124912   = 18480780714006502282899774.5778544540
263-0.123912932193769965476541321 * 0.1322135476547459213732911312 = -0.0163829683
264-0.123912932193769965476541321 * -0.123912932193769965476541321 = 0.0153544147
265-0.123912932193769965476541321 * 0                              = 0.0000000000
266-0.123912932193769965476541321 * 0.00                           = 0.0000000000
267-0.123912932193769965476541321 * -0                             = 0.0000000000
268-0.123912932193769965476541321 * -0.00                          = 0.0000000000
269-0.123912932193769965476541321 * 15                             = -1.8586939829
270-0.123912932193769965476541321 * -15                            = 1.8586939829
271-0.123912932193769965476541321 * 1                              = -0.1239129321
272-0.123912932193769965476541321 * -9                             = 1.1152163897
273-0.123912932193769965476541321 * 14.14                          = -1.7521288612
274-0.123912932193769965476541321 * -16.60                         = 2.0569546744
275-0.123912932193769965476541321 * 0.15                           = -0.0185869398
276-0.123912932193769965476541321 * -0.01                          = 0.0012391293
277