1--TEST--
2bcsub() 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$minuends = [
12    "15151324141414.412312232141241",
13    "-132132245132134.1515123765412",
14    "141241241241241248267654747412",
15    "-149143276547656984948124912",
16    "0.1322135476547459213732911312",
17    "-0.123912932193769965476541321",
18];
19$subtrahends = array_merge($minuends, [
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($minuends, $subtrahends, "-", bcsub(...));
35
36?>
37--EXPECT--
38Number "15151324141414.412312232141241" (scale 0)
3915151324141414.412312232141241 - 15151324141414.412312232141241 = 0
4015151324141414.412312232141241 - -132132245132134.1515123765412 = 147283569273548
4115151324141414.412312232141241 - 141241241241241248267654747412 = -141241241241241233116330605997
4215151324141414.412312232141241 - -149143276547656984948124912   = 149143276547672136272266326
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                             = 15151324141399
5015151324141414.412312232141241 - -15                            = 15151324141429
5115151324141414.412312232141241 - 1                              = 15151324141413
5215151324141414.412312232141241 - -9                             = 15151324141423
5315151324141414.412312232141241 - 14.14                          = 15151324141400
5415151324141414.412312232141241 - -16.60                         = 15151324141431
5515151324141414.412312232141241 - 0.15                           = 15151324141414
5615151324141414.412312232141241 - -0.01                          = 15151324141414
57
58Number "-132132245132134.1515123765412" (scale 0)
59-132132245132134.1515123765412 - 15151324141414.412312232141241 = -147283569273548
60-132132245132134.1515123765412 - -132132245132134.1515123765412 = 0
61-132132245132134.1515123765412 - 141241241241241248267654747412 = -141241241241241380399899879546
62-132132245132134.1515123765412 - -149143276547656984948124912   = 149143276547524852702992777
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                             = -132132245132149
70-132132245132134.1515123765412 - -15                            = -132132245132119
71-132132245132134.1515123765412 - 1                              = -132132245132135
72-132132245132134.1515123765412 - -9                             = -132132245132125
73-132132245132134.1515123765412 - 14.14                          = -132132245132148
74-132132245132134.1515123765412 - -16.60                         = -132132245132117
75-132132245132134.1515123765412 - 0.15                           = -132132245132134
76-132132245132134.1515123765412 - -0.01                          = -132132245132134
77
78Number "141241241241241248267654747412" (scale 0)
79141241241241241248267654747412 - 15151324141414.412312232141241 = 141241241241241233116330605997
80141241241241241248267654747412 - -132132245132134.1515123765412 = 141241241241241380399899879546
81141241241241241248267654747412 - 141241241241241248267654747412 = 0
82141241241241241248267654747412 - -149143276547656984948124912   = 141390384517788905252602872324
83141241241241241248267654747412 - 0.1322135476547459213732911312 = 141241241241241248267654747411
84141241241241241248267654747412 - -0.123912932193769965476541321 = 141241241241241248267654747412
85141241241241241248267654747412 - 0                              = 141241241241241248267654747412
86141241241241241248267654747412 - 0.00                           = 141241241241241248267654747412
87141241241241241248267654747412 - -0                             = 141241241241241248267654747412
88141241241241241248267654747412 - -0.00                          = 141241241241241248267654747412
89141241241241241248267654747412 - 15                             = 141241241241241248267654747397
90141241241241241248267654747412 - -15                            = 141241241241241248267654747427
91141241241241241248267654747412 - 1                              = 141241241241241248267654747411
92141241241241241248267654747412 - -9                             = 141241241241241248267654747421
93141241241241241248267654747412 - 14.14                          = 141241241241241248267654747397
94141241241241241248267654747412 - -16.60                         = 141241241241241248267654747428
95141241241241241248267654747412 - 0.15                           = 141241241241241248267654747411
96141241241241241248267654747412 - -0.01                          = 141241241241241248267654747412
97
98Number "-149143276547656984948124912" (scale 0)
99-149143276547656984948124912 - 15151324141414.412312232141241 = -149143276547672136272266326
100-149143276547656984948124912 - -132132245132134.1515123765412 = -149143276547524852702992777
101-149143276547656984948124912 - 141241241241241248267654747412 = -141390384517788905252602872324
102-149143276547656984948124912 - -149143276547656984948124912   = 0
103-149143276547656984948124912 - 0.1322135476547459213732911312 = -149143276547656984948124912
104-149143276547656984948124912 - -0.123912932193769965476541321 = -149143276547656984948124911
105-149143276547656984948124912 - 0                              = -149143276547656984948124912
106-149143276547656984948124912 - 0.00                           = -149143276547656984948124912
107-149143276547656984948124912 - -0                             = -149143276547656984948124912
108-149143276547656984948124912 - -0.00                          = -149143276547656984948124912
109-149143276547656984948124912 - 15                             = -149143276547656984948124927
110-149143276547656984948124912 - -15                            = -149143276547656984948124897
111-149143276547656984948124912 - 1                              = -149143276547656984948124913
112-149143276547656984948124912 - -9                             = -149143276547656984948124903
113-149143276547656984948124912 - 14.14                          = -149143276547656984948124926
114-149143276547656984948124912 - -16.60                         = -149143276547656984948124895
115-149143276547656984948124912 - 0.15                           = -149143276547656984948124912
116-149143276547656984948124912 - -0.01                          = -149143276547656984948124911
117
118Number "0.1322135476547459213732911312" (scale 0)
1190.1322135476547459213732911312 - 15151324141414.412312232141241 = -15151324141414
1200.1322135476547459213732911312 - -132132245132134.1515123765412 = 132132245132134
1210.1322135476547459213732911312 - 141241241241241248267654747412 = -141241241241241248267654747411
1220.1322135476547459213732911312 - -149143276547656984948124912   = 149143276547656984948124912
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                             = -14
1300.1322135476547459213732911312 - -15                            = 15
1310.1322135476547459213732911312 - 1                              = 0
1320.1322135476547459213732911312 - -9                             = 9
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 = -141241241241241248267654747412
142-0.123912932193769965476541321 - -149143276547656984948124912   = 149143276547656984948124911
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                             = -15
150-0.123912932193769965476541321 - -15                            = 14
151-0.123912932193769965476541321 - 1                              = -1
152-0.123912932193769965476541321 - -9                             = 8
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 = 0.0000000000
16015151324141414.412312232141241 - -132132245132134.1515123765412 = 147283569273548.5638246086
16115151324141414.412312232141241 - 141241241241241248267654747412 = -141241241241241233116330605997.5876877678
16215151324141414.412312232141241 - -149143276547656984948124912   = 149143276547672136272266326.4123122321
16315151324141414.412312232141241 - 0.1322135476547459213732911312 = 15151324141414.2800986844
16415151324141414.412312232141241 - -0.123912932193769965476541321 = 15151324141414.5362251643
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                             = 15151324141399.4123122321
17015151324141414.412312232141241 - -15                            = 15151324141429.4123122321
17115151324141414.412312232141241 - 1                              = 15151324141413.4123122321
17215151324141414.412312232141241 - -9                             = 15151324141423.4123122321
17315151324141414.412312232141241 - 14.14                          = 15151324141400.2723122321
17415151324141414.412312232141241 - -16.60                         = 15151324141431.0123122321
17515151324141414.412312232141241 - 0.15                           = 15151324141414.2623122321
17615151324141414.412312232141241 - -0.01                          = 15151324141414.4223122321
177
178Number "-132132245132134.1515123765412" (scale 10)
179-132132245132134.1515123765412 - 15151324141414.412312232141241 = -147283569273548.5638246086
180-132132245132134.1515123765412 - -132132245132134.1515123765412 = 0.0000000000
181-132132245132134.1515123765412 - 141241241241241248267654747412 = -141241241241241380399899879546.1515123765
182-132132245132134.1515123765412 - -149143276547656984948124912   = 149143276547524852702992777.8484876234
183-132132245132134.1515123765412 - 0.1322135476547459213732911312 = -132132245132134.2837259241
184-132132245132134.1515123765412 - -0.123912932193769965476541321 = -132132245132134.0275994443
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                             = -132132245132149.1515123765
190-132132245132134.1515123765412 - -15                            = -132132245132119.1515123765
191-132132245132134.1515123765412 - 1                              = -132132245132135.1515123765
192-132132245132134.1515123765412 - -9                             = -132132245132125.1515123765
193-132132245132134.1515123765412 - 14.14                          = -132132245132148.2915123765
194-132132245132134.1515123765412 - -16.60                         = -132132245132117.5515123765
195-132132245132134.1515123765412 - 0.15                           = -132132245132134.3015123765
196-132132245132134.1515123765412 - -0.01                          = -132132245132134.1415123765
197
198Number "141241241241241248267654747412" (scale 10)
199141241241241241248267654747412 - 15151324141414.412312232141241 = 141241241241241233116330605997.5876877678
200141241241241241248267654747412 - -132132245132134.1515123765412 = 141241241241241380399899879546.1515123765
201141241241241241248267654747412 - 141241241241241248267654747412 = 0.0000000000
202141241241241241248267654747412 - -149143276547656984948124912   = 141390384517788905252602872324.0000000000
203141241241241241248267654747412 - 0.1322135476547459213732911312 = 141241241241241248267654747411.8677864523
204141241241241241248267654747412 - -0.123912932193769965476541321 = 141241241241241248267654747412.1239129321
205141241241241241248267654747412 - 0                              = 141241241241241248267654747412.0000000000
206141241241241241248267654747412 - 0.00                           = 141241241241241248267654747412.0000000000
207141241241241241248267654747412 - -0                             = 141241241241241248267654747412.0000000000
208141241241241241248267654747412 - -0.00                          = 141241241241241248267654747412.0000000000
209141241241241241248267654747412 - 15                             = 141241241241241248267654747397.0000000000
210141241241241241248267654747412 - -15                            = 141241241241241248267654747427.0000000000
211141241241241241248267654747412 - 1                              = 141241241241241248267654747411.0000000000
212141241241241241248267654747412 - -9                             = 141241241241241248267654747421.0000000000
213141241241241241248267654747412 - 14.14                          = 141241241241241248267654747397.8600000000
214141241241241241248267654747412 - -16.60                         = 141241241241241248267654747428.6000000000
215141241241241241248267654747412 - 0.15                           = 141241241241241248267654747411.8500000000
216141241241241241248267654747412 - -0.01                          = 141241241241241248267654747412.0100000000
217
218Number "-149143276547656984948124912" (scale 10)
219-149143276547656984948124912 - 15151324141414.412312232141241 = -149143276547672136272266326.4123122321
220-149143276547656984948124912 - -132132245132134.1515123765412 = -149143276547524852702992777.8484876234
221-149143276547656984948124912 - 141241241241241248267654747412 = -141390384517788905252602872324.0000000000
222-149143276547656984948124912 - -149143276547656984948124912   = 0.0000000000
223-149143276547656984948124912 - 0.1322135476547459213732911312 = -149143276547656984948124912.1322135476
224-149143276547656984948124912 - -0.123912932193769965476541321 = -149143276547656984948124911.8760870678
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                             = -149143276547656984948124927.0000000000
230-149143276547656984948124912 - -15                            = -149143276547656984948124897.0000000000
231-149143276547656984948124912 - 1                              = -149143276547656984948124913.0000000000
232-149143276547656984948124912 - -9                             = -149143276547656984948124903.0000000000
233-149143276547656984948124912 - 14.14                          = -149143276547656984948124926.1400000000
234-149143276547656984948124912 - -16.60                         = -149143276547656984948124895.4000000000
235-149143276547656984948124912 - 0.15                           = -149143276547656984948124912.1500000000
236-149143276547656984948124912 - -0.01                          = -149143276547656984948124911.9900000000
237
238Number "0.1322135476547459213732911312" (scale 10)
2390.1322135476547459213732911312 - 15151324141414.412312232141241 = -15151324141414.2800986844
2400.1322135476547459213732911312 - -132132245132134.1515123765412 = 132132245132134.2837259241
2410.1322135476547459213732911312 - 141241241241241248267654747412 = -141241241241241248267654747411.8677864523
2420.1322135476547459213732911312 - -149143276547656984948124912   = 149143276547656984948124912.1322135476
2430.1322135476547459213732911312 - 0.1322135476547459213732911312 = 0.0000000000
2440.1322135476547459213732911312 - -0.123912932193769965476541321 = 0.2561264798
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                             = -14.8677864523
2500.1322135476547459213732911312 - -15                            = 15.1322135476
2510.1322135476547459213732911312 - 1                              = -0.8677864523
2520.1322135476547459213732911312 - -9                             = 9.1322135476
2530.1322135476547459213732911312 - 14.14                          = -14.0077864523
2540.1322135476547459213732911312 - -16.60                         = 16.7322135476
2550.1322135476547459213732911312 - 0.15                           = -0.0177864523
2560.1322135476547459213732911312 - -0.01                          = 0.1422135476
257
258Number "-0.123912932193769965476541321" (scale 10)
259-0.123912932193769965476541321 - 15151324141414.412312232141241 = -15151324141414.5362251643
260-0.123912932193769965476541321 - -132132245132134.1515123765412 = 132132245132134.0275994443
261-0.123912932193769965476541321 - 141241241241241248267654747412 = -141241241241241248267654747412.1239129321
262-0.123912932193769965476541321 - -149143276547656984948124912   = 149143276547656984948124911.8760870678
263-0.123912932193769965476541321 - 0.1322135476547459213732911312 = -0.2561264798
264-0.123912932193769965476541321 - -0.123912932193769965476541321 = 0.0000000000
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                             = -15.1239129321
270-0.123912932193769965476541321 - -15                            = 14.8760870678
271-0.123912932193769965476541321 - 1                              = -1.1239129321
272-0.123912932193769965476541321 - -9                             = 8.8760870678
273-0.123912932193769965476541321 - 14.14                          = -14.2639129321
274-0.123912932193769965476541321 - -16.60                         = 16.4760870678
275-0.123912932193769965476541321 - 0.15                           = -0.2739129321
276-0.123912932193769965476541321 - -0.01                          = -0.1139129321
277