xref: /PHP-8.3/ext/bcmath/tests/bcmul_zero.phpt (revision ee226128)
1--TEST--
2bcmul() function with number zero
3--EXTENSIONS--
4bcmath
5--INI--
6bcmath.scale=0
7--FILE--
8<?php
9require(__DIR__ . "/run_bcmath_tests_function.inc");
10
11$firstFactors = ["0", "0.00", "-0", "-0.00"];
12$secondFactors = array_merge($firstFactors, [
13    "15",
14    "-15",
15    "1",
16    "-9",
17    "14.14",
18    "-16.60",
19    "0.15",
20    "-0.01",
21    "15151324141414.412312232141241",
22    "-132132245132134.1515123765412",
23    "141241241241241248267654747412",
24    "-149143276547656984948124912",
25    "0.1322135476547459213732911312",
26    "-0.123912932193769965476541321",
27]);
28
29run_bcmath_tests($firstFactors, $secondFactors, "*", bcmul(...));
30
31?>
32--EXPECT--
33Number "0" (scale 0)
340 * 0                              = 0
350 * 0.00                           = 0
360 * -0                             = 0
370 * -0.00                          = 0
380 * 15                             = 0
390 * -15                            = 0
400 * 1                              = 0
410 * -9                             = 0
420 * 14.14                          = 0
430 * -16.60                         = 0
440 * 0.15                           = 0
450 * -0.01                          = 0
460 * 15151324141414.412312232141241 = 0
470 * -132132245132134.1515123765412 = 0
480 * 141241241241241248267654747412 = 0
490 * -149143276547656984948124912   = 0
500 * 0.1322135476547459213732911312 = 0
510 * -0.123912932193769965476541321 = 0
52
53Number "0.00" (scale 0)
540.00 * 0                              = 0
550.00 * 0.00                           = 0
560.00 * -0                             = 0
570.00 * -0.00                          = 0
580.00 * 15                             = 0
590.00 * -15                            = 0
600.00 * 1                              = 0
610.00 * -9                             = 0
620.00 * 14.14                          = 0
630.00 * -16.60                         = 0
640.00 * 0.15                           = 0
650.00 * -0.01                          = 0
660.00 * 15151324141414.412312232141241 = 0
670.00 * -132132245132134.1515123765412 = 0
680.00 * 141241241241241248267654747412 = 0
690.00 * -149143276547656984948124912   = 0
700.00 * 0.1322135476547459213732911312 = 0
710.00 * -0.123912932193769965476541321 = 0
72
73Number "-0" (scale 0)
74-0 * 0                              = 0
75-0 * 0.00                           = 0
76-0 * -0                             = 0
77-0 * -0.00                          = 0
78-0 * 15                             = 0
79-0 * -15                            = 0
80-0 * 1                              = 0
81-0 * -9                             = 0
82-0 * 14.14                          = 0
83-0 * -16.60                         = 0
84-0 * 0.15                           = 0
85-0 * -0.01                          = 0
86-0 * 15151324141414.412312232141241 = 0
87-0 * -132132245132134.1515123765412 = 0
88-0 * 141241241241241248267654747412 = 0
89-0 * -149143276547656984948124912   = 0
90-0 * 0.1322135476547459213732911312 = 0
91-0 * -0.123912932193769965476541321 = 0
92
93Number "-0.00" (scale 0)
94-0.00 * 0                              = 0
95-0.00 * 0.00                           = 0
96-0.00 * -0                             = 0
97-0.00 * -0.00                          = 0
98-0.00 * 15                             = 0
99-0.00 * -15                            = 0
100-0.00 * 1                              = 0
101-0.00 * -9                             = 0
102-0.00 * 14.14                          = 0
103-0.00 * -16.60                         = 0
104-0.00 * 0.15                           = 0
105-0.00 * -0.01                          = 0
106-0.00 * 15151324141414.412312232141241 = 0
107-0.00 * -132132245132134.1515123765412 = 0
108-0.00 * 141241241241241248267654747412 = 0
109-0.00 * -149143276547656984948124912   = 0
110-0.00 * 0.1322135476547459213732911312 = 0
111-0.00 * -0.123912932193769965476541321 = 0
112
113Number "0" (scale 10)
1140 * 0                              = 0.0000000000
1150 * 0.00                           = 0.0000000000
1160 * -0                             = 0.0000000000
1170 * -0.00                          = 0.0000000000
1180 * 15                             = 0.0000000000
1190 * -15                            = 0.0000000000
1200 * 1                              = 0.0000000000
1210 * -9                             = 0.0000000000
1220 * 14.14                          = 0.0000000000
1230 * -16.60                         = 0.0000000000
1240 * 0.15                           = 0.0000000000
1250 * -0.01                          = 0.0000000000
1260 * 15151324141414.412312232141241 = 0.0000000000
1270 * -132132245132134.1515123765412 = 0.0000000000
1280 * 141241241241241248267654747412 = 0.0000000000
1290 * -149143276547656984948124912   = 0.0000000000
1300 * 0.1322135476547459213732911312 = 0.0000000000
1310 * -0.123912932193769965476541321 = 0.0000000000
132
133Number "0.00" (scale 10)
1340.00 * 0                              = 0.0000000000
1350.00 * 0.00                           = 0.0000000000
1360.00 * -0                             = 0.0000000000
1370.00 * -0.00                          = 0.0000000000
1380.00 * 15                             = 0.0000000000
1390.00 * -15                            = 0.0000000000
1400.00 * 1                              = 0.0000000000
1410.00 * -9                             = 0.0000000000
1420.00 * 14.14                          = 0.0000000000
1430.00 * -16.60                         = 0.0000000000
1440.00 * 0.15                           = 0.0000000000
1450.00 * -0.01                          = 0.0000000000
1460.00 * 15151324141414.412312232141241 = 0.0000000000
1470.00 * -132132245132134.1515123765412 = 0.0000000000
1480.00 * 141241241241241248267654747412 = 0.0000000000
1490.00 * -149143276547656984948124912   = 0.0000000000
1500.00 * 0.1322135476547459213732911312 = 0.0000000000
1510.00 * -0.123912932193769965476541321 = 0.0000000000
152
153Number "-0" (scale 10)
154-0 * 0                              = 0.0000000000
155-0 * 0.00                           = 0.0000000000
156-0 * -0                             = 0.0000000000
157-0 * -0.00                          = 0.0000000000
158-0 * 15                             = 0.0000000000
159-0 * -15                            = 0.0000000000
160-0 * 1                              = 0.0000000000
161-0 * -9                             = 0.0000000000
162-0 * 14.14                          = 0.0000000000
163-0 * -16.60                         = 0.0000000000
164-0 * 0.15                           = 0.0000000000
165-0 * -0.01                          = 0.0000000000
166-0 * 15151324141414.412312232141241 = 0.0000000000
167-0 * -132132245132134.1515123765412 = 0.0000000000
168-0 * 141241241241241248267654747412 = 0.0000000000
169-0 * -149143276547656984948124912   = 0.0000000000
170-0 * 0.1322135476547459213732911312 = 0.0000000000
171-0 * -0.123912932193769965476541321 = 0.0000000000
172
173Number "-0.00" (scale 10)
174-0.00 * 0                              = 0.0000000000
175-0.00 * 0.00                           = 0.0000000000
176-0.00 * -0                             = 0.0000000000
177-0.00 * -0.00                          = 0.0000000000
178-0.00 * 15                             = 0.0000000000
179-0.00 * -15                            = 0.0000000000
180-0.00 * 1                              = 0.0000000000
181-0.00 * -9                             = 0.0000000000
182-0.00 * 14.14                          = 0.0000000000
183-0.00 * -16.60                         = 0.0000000000
184-0.00 * 0.15                           = 0.0000000000
185-0.00 * -0.01                          = 0.0000000000
186-0.00 * 15151324141414.412312232141241 = 0.0000000000
187-0.00 * -132132245132134.1515123765412 = 0.0000000000
188-0.00 * 141241241241241248267654747412 = 0.0000000000
189-0.00 * -149143276547656984948124912   = 0.0000000000
190-0.00 * 0.1322135476547459213732911312 = 0.0000000000
191-0.00 * -0.123912932193769965476541321 = 0.0000000000
192