Generate array of random values

David Nadlinger see at klickverbot.at
Mon Aug 1 11:45:13 PDT 2011


On 7/30/11 5:10 PM, Andrej Mitrovic wrote:
> Is there a simpler way to do get an array of random values?

If you don't need the random numbers to be in a certain range, you could 
use array(take(rndGen(), 1024)) – if you do need a limit, that would be 
array(map!"a % 1024"(take(rndGen(), 1024))).

David


More information about the Digitalmars-d-learn mailing list