TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Google Calculator Inaccuracies?

1 pointsby matttahover 12 years ago

2 comments

matttahover 12 years ago
I noticed this today while doing checking some totals for a project. It seems there is definitely something not right. I haven't seen this before.<p>What is also interesting is if you enter the same numbers manually into the on-screen calculator it will give you a different answer of: 7 vs 6.99999999997<p>However if you update it and search for <a href="https://www.google.com/search?q=259680.68+-+37.98+-+259635" rel="nofollow">https://www.google.com/search?q=259680.68+-+37.98+-+259635</a><p>and then enter the same numbers you get 7.70000000001 vs 7.69999999998<p>Any ideas on what is happening?
shenbergover 12 years ago
decimal fractions can't necessarily be represented by a finite amount of bits (just like the fraction 1/3 is 0.333333...). Computers work with finite amounts of bits, so you're losing some accuracy. Other representation methods could be used to store the numbers (e.g. store the nominator and denominator as whole numbers), but you can't get around the fact that an infinite amount of numbers can't be represented with a finite amount of bits (e.g. the square root of two can't be represented accurately as a ratio).