Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!cartan!naparst From: naparst@cartan.UUCP Newsgroups: comp.lang.fortran Subject: Cray amod bug Message-ID: <1373@cartan.Berkeley.EDU> Date: Sun, 1-Nov-87 01:35:22 EST Article-I.D.: cartan.1373 Posted: Sun Nov 1 01:35:22 1987 Date-Received: Tue, 3-Nov-87 01:43:18 EST Reply-To: naparst@cartan.Berkeley.EDU (Harold Naparst) Organization: Math Dept. UCB Lines: 32 > Cray II CFT77 Fortran amod function appears to give seriously wrong > results on certain occasions. It is possible the other Cray Fortran compiler > uses the same amod assembly level code; perhaps even the C and Pascal > compilers. > It sometimes returns -epsilon instead of the Y-epsilon as shown in > the following: > [ program deleted to save space] > > I am alternating between amusement, bewilderment, > and rage about such a cavalier attitude. IF X < Y BY ANY REPRESENTABLE > AMOUNT, THE R=AMOD(X,Y) MUST BE NEAR X NOT NEAR 0. The author is absolutely correct. I have verified this bug on our Cray X-MP, with both the CFT and CFT77 compilers. This is definitely a hardware bug, not just in the author's machine, but in all CRAY systems. I have reported this to our systems staff here. In some sense, this message should not have been posted to comp.lang.fortran, since it is a hardware problem, not a compiler problem. But I don't care about these things. Cray systems are renowned for their inaccuracies. You might try dividing 240.0 by 3.0. I believe you don't get exactly 80. The author should obtain a copy of Prof. William Kahan's program "Paranoia" from netlib@anl-mcs.arpa and run it on the CRAY. It fails miserably. On the other hand, if you run it on a SUN, you will find complete conformance to the IEEE standard. Harold Naparst (naparst@cartan.berkeley.edu) -- Harold Naparst (415)-848-4560 UUCP {tektronix,dual,sun,ihnp4,decvax}!ucbvax!cartan!naparst New style naparst@cartan.berkeley.edu ARPA | CSNET naparst%cartan@berkeley.ARPA