1--TEST--
2bcadd() 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$leftSummands = [
12    "15151324141414.412312232141241",
13    "-132132245132134.1515123765412",
14    "141241241241241248267654747412",
15    "-149143276547656984948124912",
16    "0.1322135476547459213732911312",
17    "-0.123912932193769965476541321",
18];
19$rightSummands = array_merge($leftSummands, [
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($leftSummands, $rightSummands, "+", bcadd(...));
35
36?>
37--EXPECT--
38Number "15151324141414.412312232141241" (scale 0)
3915151324141414.412312232141241 + 15151324141414.412312232141241 = 30302648282828
4015151324141414.412312232141241 + -132132245132134.1515123765412 = -116980920990719
4115151324141414.412312232141241 + 141241241241241248267654747412 = 141241241241241263418978888826
4215151324141414.412312232141241 + -149143276547656984948124912   = -149143276547641833623983497
4315151324141414.412312232141241 + 0.1322135476547459213732911312 = 15151324141414
4415151324141414.412312232141241 + -0.123912932193769965476541321 = 15151324141414
4515151324141414.412312232141241 + 0                              = 15151324141414
4615151324141414.412312232141241 + 0.00                           = 15151324141414
4715151324141414.412312232141241 + -0                             = 15151324141414
4815151324141414.412312232141241 + -0.00                          = 15151324141414
4915151324141414.412312232141241 + 15                             = 15151324141429
5015151324141414.412312232141241 + -15                            = 15151324141399
5115151324141414.412312232141241 + 1                              = 15151324141415
5215151324141414.412312232141241 + -9                             = 15151324141405
5315151324141414.412312232141241 + 14.14                          = 15151324141428
5415151324141414.412312232141241 + -16.60                         = 15151324141397
5515151324141414.412312232141241 + 0.15                           = 15151324141414
5615151324141414.412312232141241 + -0.01                          = 15151324141414
57
58Number "-132132245132134.1515123765412" (scale 0)
59-132132245132134.1515123765412 + 15151324141414.412312232141241 = -116980920990719
60-132132245132134.1515123765412 + -132132245132134.1515123765412 = -264264490264268
61-132132245132134.1515123765412 + 141241241241241248267654747412 = 141241241241241116135409615277
62-132132245132134.1515123765412 + -149143276547656984948124912   = -149143276547789117193257046
63-132132245132134.1515123765412 + 0.1322135476547459213732911312 = -132132245132134
64-132132245132134.1515123765412 + -0.123912932193769965476541321 = -132132245132134
65-132132245132134.1515123765412 + 0                              = -132132245132134
66-132132245132134.1515123765412 + 0.00                           = -132132245132134
67-132132245132134.1515123765412 + -0                             = -132132245132134
68-132132245132134.1515123765412 + -0.00                          = -132132245132134
69-132132245132134.1515123765412 + 15                             = -132132245132119
70-132132245132134.1515123765412 + -15                            = -132132245132149
71-132132245132134.1515123765412 + 1                              = -132132245132133
72-132132245132134.1515123765412 + -9                             = -132132245132143
73-132132245132134.1515123765412 + 14.14                          = -132132245132120
74-132132245132134.1515123765412 + -16.60                         = -132132245132150
75-132132245132134.1515123765412 + 0.15                           = -132132245132134
76-132132245132134.1515123765412 + -0.01                          = -132132245132134
77
78Number "141241241241241248267654747412" (scale 0)
79141241241241241248267654747412 + 15151324141414.412312232141241 = 141241241241241263418978888826
80141241241241241248267654747412 + -132132245132134.1515123765412 = 141241241241241116135409615277
81141241241241241248267654747412 + 141241241241241248267654747412 = 282482482482482496535309494824
82141241241241241248267654747412 + -149143276547656984948124912   = 141092097964693591282706622500
83141241241241241248267654747412 + 0.1322135476547459213732911312 = 141241241241241248267654747412
84141241241241241248267654747412 + -0.123912932193769965476541321 = 141241241241241248267654747411
85141241241241241248267654747412 + 0                              = 141241241241241248267654747412
86141241241241241248267654747412 + 0.00                           = 141241241241241248267654747412
87141241241241241248267654747412 + -0                             = 141241241241241248267654747412
88141241241241241248267654747412 + -0.00                          = 141241241241241248267654747412
89141241241241241248267654747412 + 15                             = 141241241241241248267654747427
90141241241241241248267654747412 + -15                            = 141241241241241248267654747397
91141241241241241248267654747412 + 1                              = 141241241241241248267654747413
92141241241241241248267654747412 + -9                             = 141241241241241248267654747403
93141241241241241248267654747412 + 14.14                          = 141241241241241248267654747426
94141241241241241248267654747412 + -16.60                         = 141241241241241248267654747395
95141241241241241248267654747412 + 0.15                           = 141241241241241248267654747412
96141241241241241248267654747412 + -0.01                          = 141241241241241248267654747411
97
98Number "-149143276547656984948124912" (scale 0)
99-149143276547656984948124912 + 15151324141414.412312232141241 = -149143276547641833623983497
100-149143276547656984948124912 + -132132245132134.1515123765412 = -149143276547789117193257046
101-149143276547656984948124912 + 141241241241241248267654747412 = 141092097964693591282706622500
102-149143276547656984948124912 + -149143276547656984948124912   = -298286553095313969896249824
103-149143276547656984948124912 + 0.1322135476547459213732911312 = -149143276547656984948124911
104-149143276547656984948124912 + -0.123912932193769965476541321 = -149143276547656984948124912
105-149143276547656984948124912 + 0                              = -149143276547656984948124912
106-149143276547656984948124912 + 0.00                           = -149143276547656984948124912
107-149143276547656984948124912 + -0                             = -149143276547656984948124912
108-149143276547656984948124912 + -0.00                          = -149143276547656984948124912
109-149143276547656984948124912 + 15                             = -149143276547656984948124897
110-149143276547656984948124912 + -15                            = -149143276547656984948124927
111-149143276547656984948124912 + 1                              = -149143276547656984948124911
112-149143276547656984948124912 + -9                             = -149143276547656984948124921
113-149143276547656984948124912 + 14.14                          = -149143276547656984948124897
114-149143276547656984948124912 + -16.60                         = -149143276547656984948124928
115-149143276547656984948124912 + 0.15                           = -149143276547656984948124911
116-149143276547656984948124912 + -0.01                          = -149143276547656984948124912
117
118Number "0.1322135476547459213732911312" (scale 0)
1190.1322135476547459213732911312 + 15151324141414.412312232141241 = 15151324141414
1200.1322135476547459213732911312 + -132132245132134.1515123765412 = -132132245132134
1210.1322135476547459213732911312 + 141241241241241248267654747412 = 141241241241241248267654747412
1220.1322135476547459213732911312 + -149143276547656984948124912   = -149143276547656984948124911
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                             = 15
1300.1322135476547459213732911312 + -15                            = -14
1310.1322135476547459213732911312 + 1                              = 1
1320.1322135476547459213732911312 + -9                             = -8
1330.1322135476547459213732911312 + 14.14                          = 14
1340.1322135476547459213732911312 + -16.60                         = -16
1350.1322135476547459213732911312 + 0.15                           = 0
1360.1322135476547459213732911312 + -0.01                          = 0
137
138Number "-0.123912932193769965476541321" (scale 0)
139-0.123912932193769965476541321 + 15151324141414.412312232141241 = 15151324141414
140-0.123912932193769965476541321 + -132132245132134.1515123765412 = -132132245132134
141-0.123912932193769965476541321 + 141241241241241248267654747412 = 141241241241241248267654747411
142-0.123912932193769965476541321 + -149143276547656984948124912   = -149143276547656984948124912
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                             = 14
150-0.123912932193769965476541321 + -15                            = -15
151-0.123912932193769965476541321 + 1                              = 0
152-0.123912932193769965476541321 + -9                             = -9
153-0.123912932193769965476541321 + 14.14                          = 14
154-0.123912932193769965476541321 + -16.60                         = -16
155-0.123912932193769965476541321 + 0.15                           = 0
156-0.123912932193769965476541321 + -0.01                          = 0
157
158Number "15151324141414.412312232141241" (scale 10)
15915151324141414.412312232141241 + 15151324141414.412312232141241 = 30302648282828.8246244642
16015151324141414.412312232141241 + -132132245132134.1515123765412 = -116980920990719.7392001443
16115151324141414.412312232141241 + 141241241241241248267654747412 = 141241241241241263418978888826.4123122321
16215151324141414.412312232141241 + -149143276547656984948124912   = -149143276547641833623983497.5876877678
16315151324141414.412312232141241 + 0.1322135476547459213732911312 = 15151324141414.5445257797
16415151324141414.412312232141241 + -0.123912932193769965476541321 = 15151324141414.2883992999
16515151324141414.412312232141241 + 0                              = 15151324141414.4123122321
16615151324141414.412312232141241 + 0.00                           = 15151324141414.4123122321
16715151324141414.412312232141241 + -0                             = 15151324141414.4123122321
16815151324141414.412312232141241 + -0.00                          = 15151324141414.4123122321
16915151324141414.412312232141241 + 15                             = 15151324141429.4123122321
17015151324141414.412312232141241 + -15                            = 15151324141399.4123122321
17115151324141414.412312232141241 + 1                              = 15151324141415.4123122321
17215151324141414.412312232141241 + -9                             = 15151324141405.4123122321
17315151324141414.412312232141241 + 14.14                          = 15151324141428.5523122321
17415151324141414.412312232141241 + -16.60                         = 15151324141397.8123122321
17515151324141414.412312232141241 + 0.15                           = 15151324141414.5623122321
17615151324141414.412312232141241 + -0.01                          = 15151324141414.4023122321
177
178Number "-132132245132134.1515123765412" (scale 10)
179-132132245132134.1515123765412 + 15151324141414.412312232141241 = -116980920990719.7392001443
180-132132245132134.1515123765412 + -132132245132134.1515123765412 = -264264490264268.3030247530
181-132132245132134.1515123765412 + 141241241241241248267654747412 = 141241241241241116135409615277.8484876234
182-132132245132134.1515123765412 + -149143276547656984948124912   = -149143276547789117193257046.1515123765
183-132132245132134.1515123765412 + 0.1322135476547459213732911312 = -132132245132134.0192988288
184-132132245132134.1515123765412 + -0.123912932193769965476541321 = -132132245132134.2754253087
185-132132245132134.1515123765412 + 0                              = -132132245132134.1515123765
186-132132245132134.1515123765412 + 0.00                           = -132132245132134.1515123765
187-132132245132134.1515123765412 + -0                             = -132132245132134.1515123765
188-132132245132134.1515123765412 + -0.00                          = -132132245132134.1515123765
189-132132245132134.1515123765412 + 15                             = -132132245132119.1515123765
190-132132245132134.1515123765412 + -15                            = -132132245132149.1515123765
191-132132245132134.1515123765412 + 1                              = -132132245132133.1515123765
192-132132245132134.1515123765412 + -9                             = -132132245132143.1515123765
193-132132245132134.1515123765412 + 14.14                          = -132132245132120.0115123765
194-132132245132134.1515123765412 + -16.60                         = -132132245132150.7515123765
195-132132245132134.1515123765412 + 0.15                           = -132132245132134.0015123765
196-132132245132134.1515123765412 + -0.01                          = -132132245132134.1615123765
197
198Number "141241241241241248267654747412" (scale 10)
199141241241241241248267654747412 + 15151324141414.412312232141241 = 141241241241241263418978888826.4123122321
200141241241241241248267654747412 + -132132245132134.1515123765412 = 141241241241241116135409615277.8484876234
201141241241241241248267654747412 + 141241241241241248267654747412 = 282482482482482496535309494824.0000000000
202141241241241241248267654747412 + -149143276547656984948124912   = 141092097964693591282706622500.0000000000
203141241241241241248267654747412 + 0.1322135476547459213732911312 = 141241241241241248267654747412.1322135476
204141241241241241248267654747412 + -0.123912932193769965476541321 = 141241241241241248267654747411.8760870678
205141241241241241248267654747412 + 0                              = 141241241241241248267654747412.0000000000
206141241241241241248267654747412 + 0.00                           = 141241241241241248267654747412.0000000000
207141241241241241248267654747412 + -0                             = 141241241241241248267654747412.0000000000
208141241241241241248267654747412 + -0.00                          = 141241241241241248267654747412.0000000000
209141241241241241248267654747412 + 15                             = 141241241241241248267654747427.0000000000
210141241241241241248267654747412 + -15                            = 141241241241241248267654747397.0000000000
211141241241241241248267654747412 + 1                              = 141241241241241248267654747413.0000000000
212141241241241241248267654747412 + -9                             = 141241241241241248267654747403.0000000000
213141241241241241248267654747412 + 14.14                          = 141241241241241248267654747426.1400000000
214141241241241241248267654747412 + -16.60                         = 141241241241241248267654747395.4000000000
215141241241241241248267654747412 + 0.15                           = 141241241241241248267654747412.1500000000
216141241241241241248267654747412 + -0.01                          = 141241241241241248267654747411.9900000000
217
218Number "-149143276547656984948124912" (scale 10)
219-149143276547656984948124912 + 15151324141414.412312232141241 = -149143276547641833623983497.5876877678
220-149143276547656984948124912 + -132132245132134.1515123765412 = -149143276547789117193257046.1515123765
221-149143276547656984948124912 + 141241241241241248267654747412 = 141092097964693591282706622500.0000000000
222-149143276547656984948124912 + -149143276547656984948124912   = -298286553095313969896249824.0000000000
223-149143276547656984948124912 + 0.1322135476547459213732911312 = -149143276547656984948124911.8677864523
224-149143276547656984948124912 + -0.123912932193769965476541321 = -149143276547656984948124912.1239129321
225-149143276547656984948124912 + 0                              = -149143276547656984948124912.0000000000
226-149143276547656984948124912 + 0.00                           = -149143276547656984948124912.0000000000
227-149143276547656984948124912 + -0                             = -149143276547656984948124912.0000000000
228-149143276547656984948124912 + -0.00                          = -149143276547656984948124912.0000000000
229-149143276547656984948124912 + 15                             = -149143276547656984948124897.0000000000
230-149143276547656984948124912 + -15                            = -149143276547656984948124927.0000000000
231-149143276547656984948124912 + 1                              = -149143276547656984948124911.0000000000
232-149143276547656984948124912 + -9                             = -149143276547656984948124921.0000000000
233-149143276547656984948124912 + 14.14                          = -149143276547656984948124897.8600000000
234-149143276547656984948124912 + -16.60                         = -149143276547656984948124928.6000000000
235-149143276547656984948124912 + 0.15                           = -149143276547656984948124911.8500000000
236-149143276547656984948124912 + -0.01                          = -149143276547656984948124912.0100000000
237
238Number "0.1322135476547459213732911312" (scale 10)
2390.1322135476547459213732911312 + 15151324141414.412312232141241 = 15151324141414.5445257797
2400.1322135476547459213732911312 + -132132245132134.1515123765412 = -132132245132134.0192988288
2410.1322135476547459213732911312 + 141241241241241248267654747412 = 141241241241241248267654747412.1322135476
2420.1322135476547459213732911312 + -149143276547656984948124912   = -149143276547656984948124911.8677864523
2430.1322135476547459213732911312 + 0.1322135476547459213732911312 = 0.2644270953
2440.1322135476547459213732911312 + -0.123912932193769965476541321 = 0.0083006154
2450.1322135476547459213732911312 + 0                              = 0.1322135476
2460.1322135476547459213732911312 + 0.00                           = 0.1322135476
2470.1322135476547459213732911312 + -0                             = 0.1322135476
2480.1322135476547459213732911312 + -0.00                          = 0.1322135476
2490.1322135476547459213732911312 + 15                             = 15.1322135476
2500.1322135476547459213732911312 + -15                            = -14.8677864523
2510.1322135476547459213732911312 + 1                              = 1.1322135476
2520.1322135476547459213732911312 + -9                             = -8.8677864523
2530.1322135476547459213732911312 + 14.14                          = 14.2722135476
2540.1322135476547459213732911312 + -16.60                         = -16.4677864523
2550.1322135476547459213732911312 + 0.15                           = 0.2822135476
2560.1322135476547459213732911312 + -0.01                          = 0.1222135476
257
258Number "-0.123912932193769965476541321" (scale 10)
259-0.123912932193769965476541321 + 15151324141414.412312232141241 = 15151324141414.2883992999
260-0.123912932193769965476541321 + -132132245132134.1515123765412 = -132132245132134.2754253087
261-0.123912932193769965476541321 + 141241241241241248267654747412 = 141241241241241248267654747411.8760870678
262-0.123912932193769965476541321 + -149143276547656984948124912   = -149143276547656984948124912.1239129321
263-0.123912932193769965476541321 + 0.1322135476547459213732911312 = 0.0083006154
264-0.123912932193769965476541321 + -0.123912932193769965476541321 = -0.2478258643
265-0.123912932193769965476541321 + 0                              = -0.1239129321
266-0.123912932193769965476541321 + 0.00                           = -0.1239129321
267-0.123912932193769965476541321 + -0                             = -0.1239129321
268-0.123912932193769965476541321 + -0.00                          = -0.1239129321
269-0.123912932193769965476541321 + 15                             = 14.8760870678
270-0.123912932193769965476541321 + -15                            = -15.1239129321
271-0.123912932193769965476541321 + 1                              = 0.8760870678
272-0.123912932193769965476541321 + -9                             = -9.1239129321
273-0.123912932193769965476541321 + 14.14                          = 14.0160870678
274-0.123912932193769965476541321 + -16.60                         = -16.7239129321
275-0.123912932193769965476541321 + 0.15                           = 0.0260870678
276-0.123912932193769965476541321 + -0.01                          = -0.1339129321
277