home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / spssxl / 820 next >
Encoding:
Text File  |  1993-01-21  |  2.3 KB  |  50 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!SEQUENT.CC.HULL.AC.UK!R.A.REESE
  3. Via: uk.ac.hull.cc.sequent; Thu, 21 Jan 1993 09:24:05 +0000
  4. X-Mailer: ELM [version 2.3 PL11]
  5. Original-Sender: R.A.Reese@sequent.cc.hull.ac.uk
  6. Message-ID: <SPSSX-L%93012104242188@UGA.CC.UGA.EDU>
  7. Newsgroups: bit.listserv.spssx-l
  8. Date:         Thu, 21 Jan 1993 09:23:43 WET
  9. Reply-To:     "R.A.Reese" <R.A.Reese@SEQUENT.CC.HULL.AC.UK>
  10. Sender:       "SPSSX(r) Discussion" <SPSSX-L@UGA.BITNET>
  11. From:         "R.A.Reese" <R.A.Reese@SEQUENT.CC.HULL.AC.UK>
  12. Subject:      Re: Not BUG - digital computer
  13. Comments: To: JENSEN@XANADU.CC.UTAH.edu
  14. Comments: cc: SPSSX-L list <spssx-l@uga.cc.uga.edu>
  15. In-Reply-To:  <no.id>; from "Jeffrey B. Jensen" at Jan 20, 93 5:30 pm
  16. Lines: 32
  17.  
  18. From a glance I think your problem is just in not realizing that "exact" decimal
  19. fractions do not necessarily have an exact representation in a finite binary
  20. notation. Almost always this doesn't matter, since the "error" is in the least
  21. significant bit, so is of the order of, say, 1 in 2^32.  When you do the
  22.  arithmetic
  23. and then round the answer for printing to some "sensible" precision, you don't
  24. see the error. However, two special cases have to be taken into account:
  25.  
  26. 1) comparing REAL values for exact equality (as you have done) is quite likely
  27.  to
  28. fail.
  29. 2) if you do lots of calculations and haven't analyzed the algorithm, the errors
  30. may accumulate, and you may lose all precision.  This is the basis of the
  31.  continuing
  32. and recurring debate between the "why can't I just copy the formula from the
  33.  book
  34. into a spreadsheet and save the cost of a package" and the "don't trust the
  35.  answers
  36. except from a bona fide and well-tested package" schools.
  37.  
  38. Footnote:  it is one of pieces of computing folklore that various fraudsters,
  39. working in banks, have arranged for all the rounding errors in customer accounts
  40. to be diverted into a ghost account from which they are then able to make
  41.  personal
  42. withdrawals.  It's such a nice idea that I fear it's probably an urban myth.
  43.  
  44. --
  45. (R.) Allan Reese        Janet:          r.a.reese@uk.ac.hull
  46. Head of Applications    Direct voice:   +44 482 465296
  47. Computer Centre         Voice messages: +44 482 465685
  48. Hull University         Fax:            +44 482 466441
  49. Hull HU6 7RX, U.K.
  50.