Skip to content

Commit 7acc226

Browse files
committed
Merged if conditions
1 parent b8e3933 commit 7acc226

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/math.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ static inline double php_round_helper(double value, int mode) {
127127
return integral;
128128

129129
case PHP_ROUND_CEILING:
130-
if (value > 0.0) {
131-
return fractional == 0 ? integral : integral + 1.0;
130+
if (value > 0.0 && fractional > 0.0 ) {
131+
return integral + 1.0;
132132
}
133133
return integral;
134134

135135
case PHP_ROUND_FLOOR:
136-
if (value < 0.0) {
137-
return fractional == 0 ? integral : integral - 1.0;
136+
if (value < 0.0 && fractional > 0.0) {
137+
return integral - 1.0;
138138
}
139139
return integral;
140140

0 commit comments

Comments
 (0)