home *** CD-ROM | disk | FTP | other *** search
- 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
- From: E7M2KAP@TOWSONVX.BITNET (Howard Kaplon - Towson State University)
- Newsgroups: bit.listserv.spssx-l
- Subject: More on No Bug in SPSS
- Message-ID: <01GTS2HPQOCI8Y5H5T@TOE.TOWSON.EDU>
- Date: 21 Jan 93 16:46:44 GMT
- Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.BITNET>
- Reply-To: Howard Kaplon - Towson State University <E7M2KAP@TOWSONVX.BITNET>
- Lines: 43
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Return-Path: <@OHSTVMA.ACS.OHIO-STATE.EDU:E7M2KAP@TOWSONVX.BITNET>
- X-Envelope-to: spssx-l@ohstvma.BITNET
- X-VMS-To: IN%"spssx-l@ohstvma"
- X-VMS-Cc: IN%"jensen@utahcca",E7M2KAP
- MIME-version: 1.0
- Content-transfer-encoding: 7BIT
- Comments: cc: jensen@utahcca.BITNET
-
- To further illustrate the Base 2 (binary) - Base 10 (decimal) conversion
- problems, below is a simple QBASIC program and the output. Here b1 is
- the COMPUTED vallue and b2 is the ASSIGNED answer. All values are
- double precision, but similar results occur with single precision (but
- the discrepencies show up around the sixth ecimal place).
-
- <Program Below>
-
- DEFDBL A-B
- CLS
- a1 = 6.2#
- a2 = 5.9#
- b2 = .3#
- b1 = a1 - a2
- PRINT " 6.2", " 5.9", " 6.2 - 5.9", , " 0.3"
- PRINT "____________________________________________________________"
- PRINT
- PRINT a1, a2, b1, b2
- PRINT
- IF b1 = b2 THEN PRINT "Yes" ELSE PRINT "NO!"
- END
-
- <End of Program>
-
- <Output Below>
-
- 6.2 5.9 6.2 - 5.9 0.3
- ____________________________________________________________
-
- 6.2 5.9 .2999999999999998 .3
-
- NO!
-
- <End of Output>
-
- Howard Kaplon
-
- -----------------------------------------------------------------------
- | Howard S. Kaplon | Mathematics Department |
- | BITNET: Kaplon-H@TOWSONVX.BITNET | Towson State University |
- | Internet: Kaplon-H@TOE.TOWSON.EDU | Towson, Maryland 21209-7097 |
- | Phone: (410) 830-3087 | FAX: (410) 830-2604 |
- -----------------------------------------------------------------------
-