#30462 [Opn->Bgs]: round() error
| From: | iliaa@php.net | Date: | Mon, 18 Oct 2004 21:53:53 +0000 |
| Subject: | #30462 [Opn->Bgs]: round() error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67748@lists.php.net to get a copy of this message | ||
ID: 30462
Updated by: iliaa@php.net
Reported By: haafiz at ezwebsolutions dot ca
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux
PHP Version: 4.3.8
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
check the serialize precision option.
Previous Comments:
------------------------------------------------------------------------
[2004-10-17 20:29:24] haafiz at ezwebsolutions dot ca
<?php
$g = 0;
$x[$g] = 34;
$y[$g] = 43;
echo serialize(round($x[$g]/$y[$g], 5));
?>
Output:
d:0.7907000000000000028421709430404007434844970703125;
------------------------------------------------------------------------
[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