Public bug reported:

Binary package hint: php5

The result of a suite of operation between float and integer make a
misstake when I try to compare the result with a static value

OS : hardy
Description: Ubuntu 8.04.1
Release: 8.04
PHP : 5.2.4-2ubuntu5.3


////////////////////////// CODE //////////////////////////////////////////
$frequency_total = 75;
$displayed_total = 36;
$frequency_tmp = 50;
$displayed = 24;

$frequency_ratio = 100/$frequency_total; // 1.33333333333
$frequency = $frequency_tmp * $frequency_ratio / 100; // 0.666666666667
$high_display_limit = $frequency*$displayed_total;

if ($displayed <= $high_display_limit) // 24 == 24
  echo 'ok';
else
  echo 'not ok'; // This case is thrown


// EXPECTED
OK

// HAPPENED
NOT OK

** Affects: php5 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
8<=8 => false 
https://bugs.launchpad.net/bugs/274939
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to