xref: /php-src/ext/bcmath/tests/bcmod_zero.phpt (revision ee226128)
1--TEST--
2bcmod() 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$dividends = ["0", "0.00", "-0", "-0.00"];
12$divisors = [
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($dividends, $divisors, "mod", bcmod(...));
30
31?>
32--EXPECT--
33Number "0" (scale 0)
340 mod 15                             = 0
350 mod -15                            = 0
360 mod 1                              = 0
370 mod -9                             = 0
380 mod 14.14                          = 0
390 mod -16.60                         = 0
400 mod 0.15                           = 0
410 mod -0.01                          = 0
420 mod 15151324141414.412312232141241 = 0
430 mod -132132245132134.1515123765412 = 0
440 mod 141241241241241248267654747412 = 0
450 mod -149143276547656984948124912   = 0
460 mod 0.1322135476547459213732911312 = 0
470 mod -0.123912932193769965476541321 = 0
48
49Number "0.00" (scale 0)
500.00 mod 15                             = 0
510.00 mod -15                            = 0
520.00 mod 1                              = 0
530.00 mod -9                             = 0
540.00 mod 14.14                          = 0
550.00 mod -16.60                         = 0
560.00 mod 0.15                           = 0
570.00 mod -0.01                          = 0
580.00 mod 15151324141414.412312232141241 = 0
590.00 mod -132132245132134.1515123765412 = 0
600.00 mod 141241241241241248267654747412 = 0
610.00 mod -149143276547656984948124912   = 0
620.00 mod 0.1322135476547459213732911312 = 0
630.00 mod -0.123912932193769965476541321 = 0
64
65Number "-0" (scale 0)
66-0 mod 15                             = 0
67-0 mod -15                            = 0
68-0 mod 1                              = 0
69-0 mod -9                             = 0
70-0 mod 14.14                          = 0
71-0 mod -16.60                         = 0
72-0 mod 0.15                           = 0
73-0 mod -0.01                          = 0
74-0 mod 15151324141414.412312232141241 = 0
75-0 mod -132132245132134.1515123765412 = 0
76-0 mod 141241241241241248267654747412 = 0
77-0 mod -149143276547656984948124912   = 0
78-0 mod 0.1322135476547459213732911312 = 0
79-0 mod -0.123912932193769965476541321 = 0
80
81Number "-0.00" (scale 0)
82-0.00 mod 15                             = 0
83-0.00 mod -15                            = 0
84-0.00 mod 1                              = 0
85-0.00 mod -9                             = 0
86-0.00 mod 14.14                          = 0
87-0.00 mod -16.60                         = 0
88-0.00 mod 0.15                           = 0
89-0.00 mod -0.01                          = 0
90-0.00 mod 15151324141414.412312232141241 = 0
91-0.00 mod -132132245132134.1515123765412 = 0
92-0.00 mod 141241241241241248267654747412 = 0
93-0.00 mod -149143276547656984948124912   = 0
94-0.00 mod 0.1322135476547459213732911312 = 0
95-0.00 mod -0.123912932193769965476541321 = 0
96
97Number "0" (scale 10)
980 mod 15                             = 0.0000000000
990 mod -15                            = 0.0000000000
1000 mod 1                              = 0.0000000000
1010 mod -9                             = 0.0000000000
1020 mod 14.14                          = 0.0000000000
1030 mod -16.60                         = 0.0000000000
1040 mod 0.15                           = 0.0000000000
1050 mod -0.01                          = 0.0000000000
1060 mod 15151324141414.412312232141241 = 0.0000000000
1070 mod -132132245132134.1515123765412 = 0.0000000000
1080 mod 141241241241241248267654747412 = 0.0000000000
1090 mod -149143276547656984948124912   = 0.0000000000
1100 mod 0.1322135476547459213732911312 = 0.0000000000
1110 mod -0.123912932193769965476541321 = 0.0000000000
112
113Number "0.00" (scale 10)
1140.00 mod 15                             = 0.0000000000
1150.00 mod -15                            = 0.0000000000
1160.00 mod 1                              = 0.0000000000
1170.00 mod -9                             = 0.0000000000
1180.00 mod 14.14                          = 0.0000000000
1190.00 mod -16.60                         = 0.0000000000
1200.00 mod 0.15                           = 0.0000000000
1210.00 mod -0.01                          = 0.0000000000
1220.00 mod 15151324141414.412312232141241 = 0.0000000000
1230.00 mod -132132245132134.1515123765412 = 0.0000000000
1240.00 mod 141241241241241248267654747412 = 0.0000000000
1250.00 mod -149143276547656984948124912   = 0.0000000000
1260.00 mod 0.1322135476547459213732911312 = 0.0000000000
1270.00 mod -0.123912932193769965476541321 = 0.0000000000
128
129Number "-0" (scale 10)
130-0 mod 15                             = 0.0000000000
131-0 mod -15                            = 0.0000000000
132-0 mod 1                              = 0.0000000000
133-0 mod -9                             = 0.0000000000
134-0 mod 14.14                          = 0.0000000000
135-0 mod -16.60                         = 0.0000000000
136-0 mod 0.15                           = 0.0000000000
137-0 mod -0.01                          = 0.0000000000
138-0 mod 15151324141414.412312232141241 = 0.0000000000
139-0 mod -132132245132134.1515123765412 = 0.0000000000
140-0 mod 141241241241241248267654747412 = 0.0000000000
141-0 mod -149143276547656984948124912   = 0.0000000000
142-0 mod 0.1322135476547459213732911312 = 0.0000000000
143-0 mod -0.123912932193769965476541321 = 0.0000000000
144
145Number "-0.00" (scale 10)
146-0.00 mod 15                             = 0.0000000000
147-0.00 mod -15                            = 0.0000000000
148-0.00 mod 1                              = 0.0000000000
149-0.00 mod -9                             = 0.0000000000
150-0.00 mod 14.14                          = 0.0000000000
151-0.00 mod -16.60                         = 0.0000000000
152-0.00 mod 0.15                           = 0.0000000000
153-0.00 mod -0.01                          = 0.0000000000
154-0.00 mod 15151324141414.412312232141241 = 0.0000000000
155-0.00 mod -132132245132134.1515123765412 = 0.0000000000
156-0.00 mod 141241241241241248267654747412 = 0.0000000000
157-0.00 mod -149143276547656984948124912   = 0.0000000000
158-0.00 mod 0.1322135476547459213732911312 = 0.0000000000
159-0.00 mod -0.123912932193769965476541321 = 0.0000000000
160