home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / spssxl / 822 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.1 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!auvm!TOWSONVX.BITNET!E7M2KAP
  2. From: E7M2KAP@TOWSONVX.BITNET (Howard Kaplon - Towson State University)
  3. Newsgroups: bit.listserv.spssx-l
  4. Subject: More on No Bug in SPSS
  5. Message-ID: <01GTS2HPQOCI8Y5H5T@TOE.TOWSON.EDU>
  6. Date: 21 Jan 93 16:46:44 GMT
  7. Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.BITNET>
  8. Reply-To: Howard Kaplon - Towson State University <E7M2KAP@TOWSONVX.BITNET>
  9. Lines: 43
  10. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  11. Return-Path: <@OHSTVMA.ACS.OHIO-STATE.EDU:E7M2KAP@TOWSONVX.BITNET>
  12. X-Envelope-to: spssx-l@ohstvma.BITNET
  13. X-VMS-To: IN%"spssx-l@ohstvma"
  14. X-VMS-Cc: IN%"jensen@utahcca",E7M2KAP
  15. MIME-version: 1.0
  16. Content-transfer-encoding: 7BIT
  17. Comments: cc: jensen@utahcca.BITNET
  18.  
  19. To further illustrate the Base 2 (binary) - Base 10 (decimal) conversion
  20. problems, below is a simple QBASIC program and the output.  Here b1 is
  21. the COMPUTED vallue  and b2 is the ASSIGNED answer.   All values are
  22. double precision, but similar results occur with single precision (but
  23. the discrepencies show up around the sixth ecimal place).
  24.  
  25. <Program Below>
  26.  
  27. DEFDBL A-B
  28. CLS
  29. a1 = 6.2#
  30. a2 = 5.9#
  31. b2 = .3#
  32. b1 = a1 - a2
  33. PRINT " 6.2", " 5.9", "    6.2 - 5.9", , " 0.3"
  34. PRINT "____________________________________________________________"
  35. PRINT
  36. PRINT a1, a2, b1, b2
  37. PRINT
  38. IF b1 = b2 THEN PRINT "Yes" ELSE PRINT "NO!"
  39. END
  40.  
  41. <End of Program>
  42.  
  43. <Output Below>
  44.  
  45.  6.2           5.9              6.2 - 5.9                0.3
  46. ____________________________________________________________
  47.  
  48.  6.2           5.9           .2999999999999998           .3
  49.  
  50. NO!
  51.  
  52. <End of Output>
  53.  
  54. Howard Kaplon
  55.  
  56. -----------------------------------------------------------------------
  57. | Howard S. Kaplon                    |  Mathematics Department       |
  58. | BITNET:  Kaplon-H@TOWSONVX.BITNET   |  Towson State University      |
  59. | Internet:  Kaplon-H@TOE.TOWSON.EDU  |  Towson, Maryland  21209-7097 |
  60. | Phone:  (410) 830-3087              |  FAX: (410) 830-2604          |
  61. -----------------------------------------------------------------------
  62.