K
Koppe74
Sorry for this newbee question, but here goes...
I of course knows about the rand()-function, but are there
any functions that yields an integer randomnumber
between 0 (or 1) and a *programmer defined* number - e.g.
between 0 and 47 ? I tried redefining RAND_MAX but
that obviously wasn't the way to do it...
Alternatively a function returning a random float between
0 and 1 could be used...
As a last ditch, do anybody have a function that uses
rand() and RAND_MAX to "translate" rand()'s random-
numbers to any of the above... maybe also improving
the "randomness" ? I need to make random-numbers
with a value between 1 and 30-to-50, so it obviously
need to fairly random in those ranges...
-Koppe
I of course knows about the rand()-function, but are there
any functions that yields an integer randomnumber
between 0 (or 1) and a *programmer defined* number - e.g.
between 0 and 47 ? I tried redefining RAND_MAX but
that obviously wasn't the way to do it...
Alternatively a function returning a random float between
0 and 1 could be used...
As a last ditch, do anybody have a function that uses
rand() and RAND_MAX to "translate" rand()'s random-
numbers to any of the above... maybe also improving
the "randomness" ? I need to make random-numbers
with a value between 1 and 30-to-50, so it obviously
need to fairly random in those ranges...
-Koppe