[PD-dev] Simple c++ question

Thomas Grill t.grill at gmx.net
Thu Feb 26 18:50:27 CET 2004


Hi Georg,

> I have a simple problem in c++:
> I don't know how I can set the range of rand().
> For example if I want a random number between 0 and 9, random(10) 
> doesn't
> work.

try
rand()%10

or more general
min+rand()%(max-min+1)

best greetings,
Thomas





More information about the Pd-dev mailing list