Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.fortran Subject: Re: Explain this output to me Message-ID: <1549@charon.cwi.nl> Date: 26 May 90 00:32:48 GMT References: <30499@ut-emx.UUCP> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 26 In article <30499@ut-emx.UUCP> vaughan@ut-emx.UUCP (Curt Vaughan) writes: (About 0.1 etc.) > It may also be dependent upon the machine architecture. Although > most machines now use two's complement arithmetic, the Cyber 170, > which uses the most significant bit as a sign bit (60-bit word) > produces the correct result with the original code. The Cray X-MP, > VAX 780, and Convex, all of which use two's complement arithmetic, > yield varying, but incorrect values. > This is not correct. There are only a few machines that use two's complement for floating-point. I know only: CDC-205, ETA-10, Modcomp (does it still exist?) and Gould (really 16's complement). All the others use sign/magnitude, except the Cyber 170 which uses one's complement. There is not really a difference between one's complement and sign/magnitude (except representation of course). The rounding mode remains the same. The reason you get different results on those machines is: 1. Probably the code on the Cyber 170 was compiled using rounding instructions. 2. The Cray (with the same mantissa size as the Cyber) does truncate. 3. The Vax has a different mantissa size (53 vs. 48 bits). 4. Convex has two floating point formats, both approximately the same format as the Vax, but rounding is slightly different. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl