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).