We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8e3933 commit 7acc226Copy full SHA for 7acc226
ext/standard/math.c
@@ -127,14 +127,14 @@ static inline double php_round_helper(double value, int mode) {
127
return integral;
128
129
case PHP_ROUND_CEILING:
130
- if (value > 0.0) {
131
- return fractional == 0 ? integral : integral + 1.0;
+ if (value > 0.0 && fractional > 0.0 ) {
+ return integral + 1.0;
132
}
133
134
135
case PHP_ROUND_FLOOR:
136
- if (value < 0.0) {
137
- return fractional == 0 ? integral : integral - 1.0;
+ if (value < 0.0 && fractional > 0.0) {
+ return integral - 1.0;
138
139
140
0 commit comments