> However, even if the number is not stored as indicated, ie. 3.55000000001 
> instead of a clean 3.550000000, then why does PHP take the liberty to chop 
> off that precision when converting to a string?  And why is that precision 
> not put back on when going back to a double?  It is not put back on because 
> PHP can represent 3.55 as a clean 3.5500000000, so the assignment of 
> floats, ie. $fFloat = 3.55;, is coded in error in PHP's internals!?
PHP is not the only langage with this kind of "problem", try js, pascal and so on. I 
don't know what people learn actually in computer langages courses, but one fact is, 
NEVER make binary test on non ordinal data.


> I'm going to stop ranting and go check PHP's source, make some tests in C 
> and such.  But with this type of number representation, PHP becomes 
> inaccurate in all but the most simple use of numbers.
Maybe work with bcmath. Normally it does not have common precision errors.


-- 
Pierre-Alain Joye
Freelance
Developpements et Services web/intranet
[EMAIL PROTECTED]

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to