Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hound.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxl!houxm!hound!5114djh From: 5114djh@hound.UUCP (D.HOUCK) Newsgroups: net.micro.pc Subject: Re: MS FORTRAN integer multiplying Message-ID: <374@hound.UUCP> Date: Fri, 13-Jan-84 10:01:43 EST Article-I.D.: hound.374 Posted: Fri Jan 13 10:01:43 1984 Date-Received: Sat, 14-Jan-84 03:32:06 EST Organization: Bell Labs, Holmdel NJ Lines: 16 I have just started running MS FORTRAN (V3.13) and decided to check it out with a simulation program I had run on other machines. When it didn't run correctly I traced the problem to the random number generator that I had used. This is the standard congruential method that assumes 2's complement representation of 32-bit integers and overflows are thrown away. However, it appears that large integer multiplications do not work as expected. As a simple example, the product of 2 and 1073741824(2**30) resulted in an answer of -131072(-2**17). The answer normally is the number with bit representation of a one followed by 31 zeros. Whatever you want to call that number, it's not -2**17. I would like to know if anyone has experienced similar problems or if anyone knows how integer overflows are handled in MS FORTRAN. David Houck AT&T Bell Laboratories