Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
ACC2000: Rounding Errors When You Use Floating-Point Numbers
Article ID: 210423 - View products that this article applies to.
This article was previously published under Q210423
Novice: Requires knowledge of the user interface on single-user computers.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
When you calculate by using floating-point numbers, the result is not always what you expect.
Errors similar to the example in the "More Information" section of this article occur in any programming language that uses floating-point numbers. This is because decimal fractions do not always have exact binary equivalents, which can result in rounding errors.
There are several methods that you can use to avoid rounding errors when you are using floating-point numbers:
Steps to Reproduce the BehaviorThe following steps demonstrate the way floating point calculations may affect the final result:
For more information about data types, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type Data Types in the Office Assistant or the Answer Wizard, and then click Search to view the topic.