home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14611 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.3 KB

  1. 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
  2. From: neath@brazil.psych.purdue.edu (Ian Neath)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Seed for random numbers?
  5. Summary: watch those calls!
  6. Message-ID: <BtnGGA.E42@mentor.cc.purdue.edu>
  7. Date: 27 Aug 92 16:00:09 GMT
  8. Sender: news@mentor.cc.purdue.edu (USENET News)
  9. Organization: Purdue University
  10. Lines: 18
  11.  
  12. In article <1992Aug26.213810.13252@reed.edu> bowman@reed.edu
  13. (Eric Bowman (bobo) writes:
  14. >I've written a program that used by a class here that has stochastic
  15. >elements to it.  I've been using the seconds since 1901 deal to seed
  16. >my random number generator; unfortunately, when a class uses it, they
  17. >get similar seeds and (sometimes) near identical results on different
  18. >machines.
  19.  
  20. I had this problem once.  It turned out I was using GetDateTime(&randSeed)
  21. but was calling rand() for my numbers.  It took many hours to realize
  22. that rand() was the ANSI call, Random() was the Toolbox call.  You might
  23. want to check this (and vice versa, using srand(clock()) and using Random()).
  24.  
  25. -ian
  26.  
  27. --
  28.     Ian Neath, PhD     | There are four kinds of people in this world:
  29. neath@psych.purdue.edu | cretins, fools, morons and lunatics - U. Eco
  30.