Path: utzoo!attcan!uunet!ateng!chip From: chip@ateng.ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: A Universal Random Number Generator. Message-ID: <1989Mar1.160721.8895@ateng.ateng.com> Date: 1 Mar 89 21:07:20 GMT References: <7354@pyr.gatech.EDU> <5873@bsu-cs.UUCP> <9704@smoke.BRL.MIL> <593@jhereg.Jhereg.MN.ORG> Organization: A T Engineering, Tampa, FL Lines: 20 According to mark@jhereg.Jhereg.MN.ORG (Mark H. Colburn): >The XENIX compiler, which is a descendant of a Microsoft compiler (I think), >[does not automatically consider large constants to be long]. It has been >a problem in PAX, and some other code, where I had to explicitly cast >the constant 1024 to to a long, so that the compiler wouldn't puke. Although it's true that the Xenix compiler does not promote the constant 1024 to long, that's not the issue. The issue is whether a *constant* too large for an int is automatically considered a long. The Microsoft compiler, whatever its foibles, does handle long constants correctly. It also gives a warning when it does so, which is a nice feature in my estimation. For the curious: The bug in the pax source was the calculation of "1024 * 1024", which should have been coded as "1024L * 1024L". -- Chip Salzenberg or A T Engineering Me? Speak for my company? Surely you jest! "It's no good. They're tapping the lines."