#39479 [Opn->Bgs]: printf ("%4.0f", -0.5) gives answer -1, instead of zero
| From: | derick@php.net | Date: | Mon, 13 Nov 2006 10:20:23 +0000 |
| Subject: | #39479 [Opn->Bgs]: printf ("%4.0f", -0.5) gives answer -1, instead of zero | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104892@lists.php.net to get a copy of this message | ||
ID: 39479
Updated by: derick@php.net
Reported By: hjblik at hjb-ict dot com
-Status: Open
+Status: Bogus
Bug Type: Math related
Operating System: linux
PHP Version: 4.4.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
Previous Comments:
------------------------------------------------------------------------
[2006-11-12 12:51:55] hjblik at hjb-ict dot com
Description:
------------
printf ("%2.0f", -0.5) gives answer -1, instead of zero
gcc gives 0 wich is correct
in various versions 5, 4 same problem
Reproduce code:
---------------
<?php
printf ("%4.0f\n", -0.5);
?>
Expected result:
----------------
0
Actual result:
--------------
-1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39479&edit=1