Hello,
I need to generates random number but between -0.5 and 0.5;
What's the best way? Sincerly I haven't idea how to do; I could normalize them but to do they between -0.5 and 0.5 ? I thought to do numberNormalize d - 0.5; But I notice that in this way the final number are always negative....
Any hints?
I need to generates random number but between -0.5 and 0.5;
Code:
srand( time(NULL) );
double number[5];
for (int i=0; i < 5; i++) {
number = rand() ;
}
Any hints?
Comment