We use cookies, including third-party cookies from Google to serve personalized ads through AdSense, to operate this site and understand how it is used. By continuing to browse, you accept this use. See our Privacy Policy and Terms of Use for details, including how to opt out of personalized advertising.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    What Kind of Problem-Solving Distinguishes Data Analysts From Software Engineers -- AI-generated illustration
    What Kind of Problem-Solving Distinguishes Data Analysts From Software Engineers
    7 Min Read
    chatgpt image jul 21, 2026, 04 34 30 pm
    4 Core Benefits of Predictive Maintenance after Vibration Analysis
    10 Min Read
    How Does Data Mining Boost Customer Satisfaction in Logistics? Harnessing Analytics for Results -- AI-generated illustration
    How Does Data Mining Boost Customer Satisfaction in Logistics? Harnessing Analytics for Results
    11 Min Read
    chatgpt image jul 13, 2026, 04 23 45 pm
    How Data Analytics Helps Companies Improve User Engagement
    19 Min Read
    chatgpt image jul 13, 2026, 03 59 46 pm
    How Data Analytics Improves Multi-Location Search Strategies
    10 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Floating-point errors, explained
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > Uncategorized > Floating-point errors, explained
Uncategorized

Floating-point errors, explained

DavidMSmith
DavidMSmith
3 Min Read
Floating-point errors, explained
Illustration generated with FLUX.2 [klein 4B] via Cloudflare Workers AI.
SHARE

Back in March, we looked at the reasons behind apparent arithmetic “mistakes” that can occur in software programs like R that use floating-point arithmetic, like this:    

> 1.0 – 0.9 – 0.1
[1] -2.775558e-17

Of course, the answer should be zero, but it’s not, not exactly anyway. That example (which I wish I’d thought of myself at the time) comes from an well-written and informative article published in PC Plus and available online at techradar.com. In simple, non-technical terms, it explains why such floating-point errors occur. It also gives some examples of the consequences of not anticipating such errors, like the Ariane 5 rocket that self-destructed 5 seconds after launch, or the Patriot missile that failed to target an Iraqi Scud missile that killed 28 people. 

More Read

#24: Here's a thought...
#24: Here’s a thought…
Big Data May Ease California Drought and Other Real-World Problems
Some thoughts on perfect application development
#17: Here’s a thought…
The QbD Column: Achieving Robustness with Stochastic Emulators

These horror stories explain why good programmers should always be aware of the pitfalls of using floating-point arithmetic and to program defensively to avoid them. (I gave some tips for R in that article from March.) It’s a great article to send next time someone asks you why their code isn’t giving a exactly the right result when they think it should.

TechRadar.com: Why computers suck at maths


Share This Article
Facebook Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

Flat editorial illustration: The article connects fragmented social-service records through shared pathways and selective informa
Turning Disconnected Information Data Into Better Social Service Outcomes
Big Data
Flat editorial illustration: The article explains how one KYC upload becomes separate records held by a verification vendor and a
What Happens to My KYC Data Behind the Approval Screen?
Big Data Exclusive
Flat editorial illustration: The article connects AI-generated avatar variants with disciplined, measurable video experiments. A
How to Use an AI Avatar Generator to Run Measurable Video Experiments
Artificial Intelligence Exclusive
Flat editorial illustration: The article’s core relationship is between growing compute density and adaptable rack hardware that
6 Details That Make a Data Centre’s Server Room Easier to Scale
Best Practices Data Management Exclusive IT

Stay Connected

1.2KFollowersLike
33.7KFollowersFollow
222FollowersPin

You Might also Like

How IT Services Companies can Thrive in the Age of Cloud
Uncategorized

How IT Services Companies can Thrive in the Age of Cloud

5 Min Read
Buying Email Lists vs. Using Data-as-a-Service (DaaS)
Uncategorized

Buying Email Lists vs. Using Data-as-a-Service (DaaS)

6 Min Read
The Importance of Data Experimentation
Uncategorized

The Importance of Data Experimentation

4 Min Read
Cloudsourcing, new options in the cloud
Uncategorized

Cloudsourcing, new options in the cloud

7 Min Read

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence
ai chatbot
How AI Website Chatbots Improve Customer Support and Lead Generation
Chatbots Exclusive

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-26 SmartData Collective. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?