By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    football analytics
    The Role of Data Analytics in Football Performance
    9 Min Read
    data Analytics instagram stories
    Data Analytics Helps Marketers Make the Most of Instagram Stories
    15 Min Read
    analyst,women,looking,at,kpi,data,on,computer,screen
    What to Know Before Recruiting an Analyst to Handle Company Data
    6 Min Read
    AI analytics
    AI-Based Analytics Are Changing the Future of Credit Cards
    6 Min Read
    data overload showing data analytics
    How Does Next-Gen SIEM Prevent Data Overload For Security Analysts?
    8 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-23 SmartData Collective. All Rights Reserved.
Reading: Floating-point errors, explained
Share
Notification Show More
Aa
SmartData CollectiveSmartData Collective
Aa
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
Last updated: 2009/11/05 at 4:18 PM
DavidMSmith
3 Min Read
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. 

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.

More Read

big data improves

3 Ways Big Data Improves Leadership Within Companies

IT Is Not Analytics. Here’s Why.
Romney Invokes Analytics in Rebuke of Trump
WEF Davos 2016: Top 100 CEO bloggers
In Memoriam: Robin Fray Carey

TechRadar.com: Why computers …



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. 

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

Link to original post

DavidMSmith November 5, 2009
Share This Article
Facebook Twitter Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

Shutterstock Licensed Photo - 1051059293 | Rawpixel.com
QR Codes Leverage the Benefits of Big Data in Education
Big Data
football analytics
The Role of Data Analytics in Football Performance
Analytics Big Data Exclusive
smart home data
7 Mind-Blowing Ways Smart Homes Use Data to Save Your Money
Big Data
ai low code frameworks
AI Can Help Accelerate Development with Low-Code Frameworks
Artificial Intelligence

Stay Connected

1.2k Followers Like
33.7k Followers Follow
222 Followers Pin

You Might also Like

big data improves
Big DataJobsKnowledge ManagementUncategorized

3 Ways Big Data Improves Leadership Within Companies

6 Min Read
Image
Uncategorized

IT Is Not Analytics. Here’s Why.

7 Min Read

Romney Invokes Analytics in Rebuke of Trump

4 Min Read

WEF Davos 2016: Top 100 CEO bloggers

14 Min Read

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

data-driven web design
5 Great Tips for Using Data Analytics for Website UX
Big Data
ai in ecommerce
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
Go to mobile version
Welcome Back!

Sign in to your account

Lost your password?