File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ foreach ($modes as $modeKey => $mode) {
31
31
foreach ($ precisions as $ precision ) {
32
32
echo "\tprecision: $ precision \n" ;
33
33
foreach ($ numbers as $ number ) {
34
- $ result = round ($ number , $ precision );
34
+ $ result = round ($ number , $ precision, $ mode );
35
35
echo "\t\t" .
36
36
str_pad ($ number , 7 , " " , STR_PAD_LEFT ) .
37
37
" => $ result \n" ;
@@ -105,10 +105,10 @@ mode: PHP_ROUND_HALF_UP
105
105
106
106
mode: PHP_ROUND_HALF_DOWN
107
107
precision: 0
108
- 2.5 => 3
109
- -2.5 => -3
110
- 3.5 => 4
111
- -3.5 => -4
108
+ 2.5 => 2
109
+ -2.5 => -2
110
+ 3.5 => 3
111
+ -3.5 => -3
112
112
7 => 7
113
113
-7 => -7
114
114
0.61 => 1
@@ -166,8 +166,8 @@ mode: PHP_ROUND_HALF_DOWN
166
166
167
167
mode: PHP_ROUND_HALF_EVEN
168
168
precision: 0
169
- 2.5 => 3
170
- -2.5 => -3
169
+ 2.5 => 2
170
+ -2.5 => -2
171
171
3.5 => 4
172
172
-3.5 => -4
173
173
7 => 7
@@ -229,8 +229,8 @@ mode: PHP_ROUND_HALF_ODD
229
229
precision: 0
230
230
2.5 => 3
231
231
-2.5 => -3
232
- 3.5 => 4
233
- -3.5 => -4
232
+ 3.5 => 3
233
+ -3.5 => -3
234
234
7 => 7
235
235
-7 => -7
236
236
0.61 => 1
You can’t perform that action at this time.
0 commit comments