Why is it that when I get access to perform a calculation in a query such as Expres1:=[value1]/100
I get an answer such as 0.850000023841858 instead of just .85? This is having an effect down the line and resulting in mathematical errors!
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Incorrect calculation!
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Incorrect calculation!
- This topic has 5 replies, 4 voices, and was last updated 24 years, 1 month ago.
AuthorTopicWSPlainsman
AskWoody LoungerMarch 11, 2001 at 11:37 pm #353806Viewing 1 reply threadAuthorReplies-
WScharlotte
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusMarch 12, 2001 at 7:01 am #518424For the same reason that you don’t get .33 when you divide 1 by 3 in decimal arithmetic. When you convert [value1] and 100 to binary floating point numbers and thendivide them, the answer does not come out to excactly .85 because of rounding errors, it comes out to 0.850000023841858. You can fix this by changing your formula to:
Expres1:=Round([value1]/100,2)
In the above, the 2 is the number of decimal place to which you want to round, in this case 2 to give you .85.
-
WSPlainsman
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusMarch 12, 2001 at 7:59 am #518428The value is not wrong, it is correct in the number system used by computers. In decimal, 2/3 to 14 decimals is: .66666666666667. Is that incorrect because the 6 in the 15th place caused the last digit to round up to 7? But, yes, if you want 14 digits, you will have to settle for the rounding error you get when you do deicmal arithmetic in binary floating point.
-
WSDouglas Martin
AskWoody LoungerMarch 12, 2001 at 2:30 pm #518450Define “wrong”!
Computers “like” to do arithmetic using the base 2 (i.e. binary) system. That’s no big deal for integers; what is an integer in one number system is an integer in any other number system. It DOES matter for floating point (i.e. fractions).
What is a repeating decimal in one base (e.g. 1/3 = 0.333333…. in base 10) is not necessarily a repeating decimal in another base. 1/3 in base 10 is 1/10 in base 3, which is 0.1 in base 3. 1/10 (or .1) in base 10 is 1/1010 in base 2, which is the repeating binary fraction .00110011….
That’s a long-winded way of saying that you’ll get rounding errors in floating point arithmetic on computers even where you might think that a particular fraction can be represented exactly.
There are often ways around that at a cost of efficiency or number range. For instance, if all you care about is 2 decimal places, you can multiply everything by 100 and work in integers (e.g. store cents rather than dollars). That’s basically how the currency type works except that it scales by 10000 rather than 100 to allow 4 decimal places.
PS Hey! I found somebody else with my initials!
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
31 minutes ago -
Office apps read-only for family members
by
b
3 hours, 7 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
8 hours, 9 minutes ago -
24H2??
by
CWBillow
8 hours, 51 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
11 hours, 53 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
5 hours, 6 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
11 hours, 33 minutes ago -
two pages side by side land scape
by
marc
2 days ago -
Deleting obsolete OneNote notebooks
by
afillat
2 days, 3 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
1 day, 5 hours ago -
Security Essentials or Defender?
by
MalcolmP
1 day, 8 hours ago -
April 2025 updates out
by
Susan Bradley
3 hours, 37 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
1 day, 2 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
16 hours, 5 minutes ago -
Creating an Index in Word 365
by
CWBillow
1 day, 18 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
6 hours, 39 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
2 days, 21 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
3 days, 1 hour ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 days, 3 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
3 days, 1 hour ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
2 days, 18 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 day ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
3 days, 6 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
4 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
3 days, 15 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
2 days, 23 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
2 days, 23 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
4 days, 8 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
4 days, 16 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
16 hours, 5 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.