ID:               25936
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sebastian dot sieburg at partyleader dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Variables related
 Operating System: Linux, BSD, etc. ..
 PHP Version:      Irrelevant
 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

See <http://de.php.net/manual/de/language.types.float.php>.


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

[2003-10-21 11:34:30] sebastian dot sieburg at partyleader dot de

Description:
------------
set a var using round, the other via value ... compare the vars .. same
values but comparision returns false .. tried in php 4.3.1, 5.0.0-dev
and 4.1.2 .. same problem in all versions ..

Reproduce code:
---------------
<?php
        $val = 1.11;
        echo "\$val: "; var_dump ($val);

        $p1 = $val * 100;
        $p2 = round ($val * 100);

        $p1 = (float)$p1;
        $p2 = (float)$p2;

        if ($p1 == $p2)
                echo "$p1 == $p2";
        else
                echo "$p1 != $p2";

        echo "\n";
        echo "\$p1: "; var_dump ($p1);
        echo "\$p2: "; var_dump ($p2);

?>

Expected result:
----------------
$val: float(1.11)
111 == 111
$p1: float(111)
$p2: float(111)


Actual result:
--------------
$val: float(1.11)
111 != 111
$p1: float(111)
$p2: float(111)



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


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

Reply via email to