#30462 [Fbk->Opn]: round() error
| From: | haafiz at ezwebsolutions dot ca | Date: | Sun, 17 Oct 2004 18:29:28 +0000 |
| Subject: | #30462 [Fbk->Opn]: round() error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67690@lists.php.net to get a copy of this message | ||
ID: 30462
User updated by: haafiz at ezwebsolutions dot ca
Reported By: haafiz at ezwebsolutions dot ca
-Status: Feedback
+Status: Open
Bug Type: *General Issues
Operating System: Linux
PHP Version: 4.3.8
New Comment:
<?php
$g = 0;
$x[$g] = 34;
$y[$g] = 43;
echo serialize(round($x[$g]/$y[$g], 5));
?>
Output:
d:0.7907000000000000028421709430404007434844970703125;
Previous Comments:
------------------------------------------------------------------------
[2004-10-17 13:08:20] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2004-10-17 04:14:13] haafiz at ezwebsolutions dot ca
Description:
------------
two variable, $x[$g] and $y[$g]...
serialize($x[$g]) returns: i:34;
serialize($y[$g]) returns: i:43;
but
serialize(round($x[$g]/$y[$g], 5)) returns:
d:0.7907000000000000028421709430404007434844970703125;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30462&edit=1