Quote:
>hello world --
>i fully understand how to use the rand(), srand(), and randomize()
>functions.
randomize() is not a function from the standard C library, and there
are completely different functions trading under that name in popular
implementations of the C programming language.
Quote:
>however, i would like to enquire of the gurus out there if
>they know exactly how these functions work.
If you really need a "guru", comp.lang.c is probably the wrong place
to look. Caves in northern India might be a better place to start
your quest.
Quote:
>specifically, i'm using
>borland turbo c/c++ 3.0 for dos. so how *does* the rand() function
>actually work?
Have you tried to consult you manual, or, if you do not find anything
in there, Borland's customer support.
Quote:
>what's the algorithm that is used to implement it? does
>this vary from compiler to compiler and from platform to platform?
It differs from one implementation of the standard C library to the
other. So, linking a program compiled with the same compiler on the
same platform against different builds of the standard C library
may invoke different implementations of rand() and srand()
There are lots of different possible implementations of pseudo random
number generators. None of them will generate a random sequence, i.e.
a sequence that is not computable, but shows relative frequencies
converging with the length of a subsequence on every subsequence.
Kurt
--
| Kurt Watzka Phone : +49-89-2180-6254