File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1250,6 +1250,7 @@ PHP_FUNCTION(min)
12501250 min = & args [i ];
12511251 }
12521252 } else if (Z_TYPE (args [i ]) == IS_DOUBLE && (zend_dval_to_lval ((double ) min_lval ) == min_lval )) {
1253+ /* if min_lval can be exactly represented as a float, go to float dedicated code */
12531254 min_dval = (double ) min_lval ;
12541255 goto double_compare ;
12551256 } else {
@@ -1269,6 +1270,7 @@ PHP_FUNCTION(min)
12691270 min = & args [i ];
12701271 }
12711272 } else if (Z_TYPE (args [i ]) == IS_LONG && (zend_dval_to_lval ((double ) Z_LVAL (args [i ])) == Z_LVAL (args [i ]))) {
1273+ /* if the value can be exactly represented as a float, use float dedicated code otherwise generic */
12721274 if (min_dval > (double )Z_LVAL (args [i ])) {
12731275 min_dval = (double )Z_LVAL (args [i ]);
12741276 min = & args [i ];
@@ -1337,6 +1339,7 @@ PHP_FUNCTION(max)
13371339 max = & args [i ];
13381340 }
13391341 } else if (Z_TYPE (args [i ]) == IS_DOUBLE && (zend_dval_to_lval ((double ) max_lval ) == max_lval )) {
1342+ /* if max_level can be exactly represented as a float, go to float dedicated code */
13401343 max_dval = (double ) max_lval ;
13411344 goto double_compare ;
13421345 } else {
@@ -1356,6 +1359,7 @@ PHP_FUNCTION(max)
13561359 max = & args [i ];
13571360 }
13581361 } else if (Z_TYPE (args [i ]) == IS_LONG && (zend_dval_to_lval ((double ) Z_LVAL (args [i ])) == Z_LVAL (args [i ]))) {
1362+ /* if the value can be exactly represented as a float, use float dedicated code otherwise generic */
13591363 if (max_dval < (double )Z_LVAL (args [i ])) {
13601364 max_dval = (double )Z_LVAL (args [i ]);
13611365 max = & args [i ];
You can’t perform that action at this time.
0 commit comments