Re: [PHP] when 1+1 is not equal to 2... STRANGE float behavior

2002-01-21 Thread Marc Swanson
Answered my own question... rounding using the "round" function to two decimal places did the trick: = $contract_amount)\n\n"; if(($paid_to_date + $billable_this_month) >= $contract_amount) { echo"true"; } else { echo"false"; } ?> now outputs "true". :-) -- --

[PHP] when 1+1 is not equal to 2... STRANGE float behavior

2002-01-21 Thread Marc Swanson
I understand the issues about binary precision for floating point numbers on standard base 2 systems but I'm unsure of the propper way to fix this problem. Here is the base test case: = $contract_amount)\n\n"; if(($paid_to_date + $billable_this_month) >= $contract_amount) { echo"t