delorie.com/archives/browse.cgi | search |
Xref: | news2.mv.net comp.os.msdos.djgpp:7409 |
From: | stwand07 AT uctvms DOT uct DOT ac DOT za |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: rand(), random() or libg++ Random ? |
Date: | 16 Aug 96 16:29:04 +0200 |
Organization: | University of Cape Town |
Lines: | 16 |
Message-ID: | <1996Aug16.162904@uctvms.uct.ac.za> |
References: | <1996Aug13 DOT 140921 AT uctvms DOT uct DOT ac DOT za> <32133A59 DOT 4F7BC6E0 AT alcyone DOT com> |
NNTP-Posting-Host: | uctvms.uct.ac.za |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
In article <32133A59 DOT 4F7BC6E0 AT alcyone DOT com>, Erik Max Francis <max AT alcyone DOT com> writes: > stwand07 AT uctvms DOT uct DOT ac DOT za wrote: >> I am busy working on an optimisation program that makes extensive use of random >> number (stochastic search). I have been using srand(time(NULL)) and rand() to >> give random numbers in the range 0..1, which I then scale as required. > > Er, rand gives values in the range of 0 to RAND_MAX. > Yes, I know (float)rand()/RAND_MAX gives values from 0..1. Adios Mark Wodrich.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |