[EMAIL PROTECTED] wrote: > I don't know if it is intentional but the values you are comparing > are exponential. > > So the comparison is of two incredibly small numbers. The > numbers are so small they are equal for all intents or purposes. > "small" is subjective. The earth is only rounding error as far as the universe is concerned, but it is very important to us.
To my mind this is a major bug, if you're right. It's as bad as "IF 100 = 0.01" were to return TRUE. (Which is exactly the same comparison, scaled up.) The correct way of dealing with rounding error is for the internal logic to be along the lines of "IF (A-B)/A < 1E-6 THEN RETURN TRUE ELSE RETURN FALSE". While I'm pretty certain 6 is the wrong number, there is a concrete justification for it - when comparing FLOAT*4 numbers it guarantees that you are using the best available precision without falling over processor rounding artifacts. There is a similar number for FLOAT*8, which is what I think UV uses internally. (And I'm assuming A and B are positive, correct appropriately for negative numbers :-) Cheers, Wol ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/