home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!uakari.primate.wisc.edu!ames!purdue!mentor.cc.purdue.edu!brazil.psych.purdue.edu!neath
- From: neath@brazil.psych.purdue.edu (Ian Neath)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Seed for random numbers?
- Summary: watch those calls!
- Message-ID: <BtnGGA.E42@mentor.cc.purdue.edu>
- Date: 27 Aug 92 16:00:09 GMT
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- Lines: 18
-
- In article <1992Aug26.213810.13252@reed.edu> bowman@reed.edu
- (Eric Bowman (bobo) writes:
- >I've written a program that used by a class here that has stochastic
- >elements to it. I've been using the seconds since 1901 deal to seed
- >my random number generator; unfortunately, when a class uses it, they
- >get similar seeds and (sometimes) near identical results on different
- >machines.
-
- I had this problem once. It turned out I was using GetDateTime(&randSeed)
- but was calling rand() for my numbers. It took many hours to realize
- that rand() was the ANSI call, Random() was the Toolbox call. You might
- want to check this (and vice versa, using srand(clock()) and using Random()).
-
- -ian
-
- --
- Ian Neath, PhD | There are four kinds of people in this world:
- neath@psych.purdue.edu | cretins, fools, morons and lunatics - U. Eco
-