ID:               16544
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Math related
 Operating System: Windows
 PHP Version:      4.1.2
 New Comment:

The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php




Previous Comments:
------------------------------------------------------------------------

[2002-04-11 04:55:49] [EMAIL PROTECTED]

Here's the code

<?
$quantities = array(5000.00, 1000.00, 200.00);
$amount = 6200;
debug($quantities);

foreach ($quantities as $quantity) {
        
        $divVal = ($amount/$quantity);  
        echo ++$i.". Quantity:\n".$quantity."<BR>";
        echo "divVal: ".$divVal." - ".var_dump($divVal)."<BR>\n";
        echo "Amount: ".$amount."\n";
        
        if (floor($divVal) > 0) {
                echo "&nbsp;[floored divVal is greater than zero]\n";
                $amount = ($divVal - floor($divVal)) * $quantity;
        }
        echo "<BR><BR>";
}


?>

You'll see the floor function is operating incorrectly?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16544&edit=1

Reply via email to