Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Getting stranger values in subtraction

by MidLifeXis (Monsignor)
on Feb 08, 2016 at 13:55 UTC ( [id://1154631]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting stranger values in subtraction
in thread Getting stranger values in subtraction

This might be a bit strong. Perhaps "Naive Programmers cannot be trusted to use computers to do arithmetic." :-)

If you are aware of the limitations based on how the hardware, libraries, and language does arithmetic (iow - know your tools), computers can be used to do the job just fine. I had two courses in this in college that dealt with this topic - one in the math department and one in the CS department. It is a similar concept to students writing down a highly precise, but terribly inaccurate answer on a test because they didn't understand significant digits and error accumulation.

--MidLifeXis

  • Comment on Re^2: Getting stranger values in subtraction

Replies are listed 'Best First'.
Re^3: Getting stranger values in subtraction
by hdb (Monsignor) on Feb 08, 2016 at 19:27 UTC

    Fully agree. In this context -3.5527136788005e-015 seems to be close enough to zero for any practical purpose.

    But this "naive" behavior can be seen so often not only with students but also in real applications for commercial purposes (which costs real money).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1154631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found