Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!dsac!dsacg2!nor1675 From: nor1675@dsacg2.UUCP (Michael Figg) Newsgroups: comp.sys.amiga Subject: Lattice random number functions Keywords: Lattice, Random numbers Message-ID: <755@dsacg2.UUCP> Date: 1 Nov 89 14:37:46 GMT Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 24 I have very little experience with random number generators but have a need now, although don't care that much being truely random, as discussed here recently. I tried the Lattice function 'drand48' last night, which from the documentation, seems to use an internal seed. The docs indicated that this function would give me a number from 0.0 up to 1.0 (which is what I want), but I keep getting 0.00000 which is of course in the range but I don't think I should get it every time. This is what I did (from memory): #include void main() { double x; x = drand48(); printf("Random number = %f\n",x); } Any ideas what is wrong here? This is Lat 5.02. Haven't installed 5.04 yet. Thanks -- "Hot Damn! Groat Cakes Again | Michael Figg Heavy on the thirty weight!" | DLA Systems Automation Center - Columbus,Oh