Path: utzoo!attcan!uunet!husc6!rutgers!cmcl2!lanl!beta!dd From: dd@beta.lanl.gov (Dan Davison) Newsgroups: comp.lang.fortran Subject: CFT/CFT77 gotcha Keywords: truncation 47 vs. 48 bits Message-ID: <23252@beta.lanl.gov> Date: 21 Jan 89 05:54:28 GMT Organization: Los Alamos National Laboratory Lines: 20 I came across an interesting non-bug in CFT77 today. A program fragment: a = 6.0 b = 3.0 i = a / b gave the result "2" in CFT on a X/MP-48 and "1" in CFT77 on the same machine. Apparently CFT did the equivalent of a NINT() after a force-to- integer; CFT77 doesn't. One consultant here said it had to do with the loss of precision in the last bit, which makes sense. Another consultant said the moral was don't used mixed mode arithmetic if you want accurate results. At least I didn't write the code! Now, is this a bug or a feature? A look through the back of the CFT77 manual (Appendix B) indicates that I'm going to become very familiar with NINT() and IDNINT()...