Re: random integer



osmium wrote:
"Gene" writes:

But note that standard rand() is a very bad random number
generator.

There is no such thing as a standard rand(); something that does
not exist can not be either good or bad. Each vendor is allowed
to include whatever he thinks appropriate to the library that goes
with his compiler.

Er - See N869:

7.20.2.1 The rand function

Synopsis

[#1]
#include <stdlib.h>
int rand(void);

Description

[#2] The rand function computes a sequence of pseudo-random
integers in the range 0 to RAND_MAX.

[#3] The implementation shall behave as if no library
function calls the rand function.

Returns

[#4] The rand function returns a pseudo-random integer.

Environmental limits

[#5] The value of the RAND_MAX macro shall be at least
32767.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net


--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Random numbers in 5mx Sheet
    ... >>> This should seed the Rand function. ... Of course it will always be pseudo-random. ... but it underlines the problem with RAND. ... In fact, cell B8 is pointless, because it will always use the same ...
    (comp.sys.psion.apps)
  • Re: Formula to choose X number of unique random cells from array?
    ... Assume the name are in column A, and the Rand function in B (you have to ... Jean-Yves Tfelt ... "Techhead" wrote: ... The rand function will also be recalculted each time a sortin is done. ...
    (microsoft.public.excel.programming)
  • Re: Random number help
    ... help rand ... Nishant wrote: ... > sequence of values in each iteration of the for loop. ... > please guide me as to what is the best way to utilize RAND function ...
    (comp.soft-sys.matlab)
  • Re: random is not random enough?
    ... > stop the program and re-run it, the same sequence is produced. ... That is that under the hood this random calls srand once and then calls ... rand after that. ... The rand function is a pseudo random generator. ...
    (comp.lang.c)