Traditional floating-point datatypes (float, double, and long double in C, C++, Java, etc) are all subject to round-off errors that can become very significant over a large number of iterations. This is true even if you're not using all those digits of precision.
Fortunately, there are other ways to get around the problem such as using fixed precision datatypes. For example, here's one implementation sold by Base One. Another common technique is to use Binary Coded Decimal (BCD) to represent each digit for very large numbers. This has a lot more processing overhead that conventional integers or float-point datatypes but can handle very large numbers with no roundoff error. This stuff is commonly taught in computer science classes.
Space/Science » in reply to Re: Floating point errors
You can used fixed-precision numeric datatypes
