ID:               28515
 Updated by:       [EMAIL PROTECTED]
 Reported By:      andrew dot panin at nvkz dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Output Control
 Operating System: Windows 98 SE
 PHP Version:      Irrelevant
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.
 
Thank you for your interest in PHP.

Look at this:
[EMAIL PROTECTED] php-cvs $ php -r 'var_dump(3*(7/3 - 2) == 1);'
bool(false)

(7/3-2) == 1/3 but a float can never be 1/3 exact.
E.g. floats cannot handle fractions.


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

[2004-05-25 06:20:54] andrew dot panin at nvkz dot net

Description:
------------
Just look into the code!

Reproduce code:
---------------
<?php
 $in="1234567";
 $d = 0;
 $d = 3*abs(strlen($in)/3 - floor(strlen($in)/3));

  print $d;
//here $d=1, as it PHP print

 if ($d == 1) { print "E"; }
//The "E" is NOT prints!

 die();
?>

Expected result:
----------------
That the "E" will be shown.

Actual result:
--------------
NOTHING!!!


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


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

Reply via email to