P
Profil1
hi, is this the correct way to generate floating point random numbers >= 0.0
and <= 1.0 that are different each time the program is run?
#include <stdlib.h>
#include <time.h>
srand( (unsigned)time( NULL ) ); //call it only once in a program liftime??
float random_value = rand()/RAND_MAX;
and <= 1.0 that are different each time the program is run?
#include <stdlib.h>
#include <time.h>
srand( (unsigned)time( NULL ) ); //call it only once in a program liftime??
float random_value = rand()/RAND_MAX;