Aamir Mahmood wrote:
Try
What is the question?
If you google for floating point errors, you should find tons of
information about this problem.
In short, a floating point value stored in a N-bit register is always
going to be an approximation of the real value. You will experience both
the case you see, that the value is slightly higher than what you expect
it to be, and the opposite, that it is slightly lower.
This is normal, can't be fixed, except for using a type with higher
precision and you must deal with it in your code.
As a quick-fix, try using the Decimal type.
--
Lasse Vågsæther Karlsen
mailto:la***@vk arlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3