Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!deimos.cis.ksu.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: ambiguous ? Message-ID: <225800227@uxe.cso.uiuc.edu> Date: 22 Oct 89 00:27:19 GMT References: <20974@gryphon.COM> Lines: 29 Nf-ID: #R:gryphon.COM:20974:uxe.cso.uiuc.edu:225800227:000:1158 Nf-From: uxe.cso.uiuc.edu!mcdonald Oct 21 10:31:00 1989 >> >> I = RAND(very carefully designed seed) >> CALL HOOPY(RAND(0), RAND(0), RAND(0)) >> >> Will this program produce the same output on different machines? Is this >> guaranteed? >The call to HOOPY is not standard conforming. The relevant part of the >standard is: > 6.6.2 [...] > In a statement that contains more than one function > reference, the value provided by each function reference > must be independent of the order chosen by the processor for > evaluation of the function references. That last paragraph doesn't seem to apply - if RAND(0) produces truly random numbers (my best one really does - absolutely, truly random, as best as I can tell. It digitizes noise.), then the requirement in the standard is met. Since the value of each function reference is independent of everything, it is independent of the order of calling it! Of course, if you use a FAKE rundom number generator - well, that is an interesting question. IF it is a really good one, the program should still give "correct" answers. Of course if you don't REALLY want randomness, then the fragemnt is clearly non-conforming. Doug McDonald