Random Function in UDF per DPM
Hi users, I need to generate an array of random part_id #. I tried to use c function 'rand()%scalefactor' and 'srand(time(NULL))' but I need number between 1:10,000,000 and rand() returns numbers bw 0:37,***. How doing? THANKS a lot! Adriano
Re: Random Function in UDF per DPM
If rand() returns real numbers then you would just have to boost them to the size you want, i.e.
your_random_number = rand() * (10000000.0 / 37.0);
|All times are GMT -4. The time now is 20:18.|