Skip to content

Commit ebc9821

Browse files
lacatoiremvorisek
andauthored
Update formatted_print.c
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
1 parent 39bf8af commit ebc9821

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

ext/standard/formatted_print.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,6 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos,
268268
&is_negative, &num_buf[1], &s_len);
269269
/* Prevent negative sign when value rounds to zero (GH-12237) */
270270
if (is_negative) {
271-
double rounded;
272-
if (fmt == 'f' || fmt == 'F') {
273-
double factor = pow(10.0, (double)precision);
274-
rounded = round(fabs(number) * factor) / factor;
275-
} else {
276-
rounded = fabs(number);
277-
}
278271
if (rounded == 0.0) {
279272
is_negative = false;
280273
}

0 commit comments

Comments
 (0)