I'm working now on a project with c# and windows form , I have to generate random floating numbers between 0,1 using random rand= new random() ; float rnd=(float)rand.nextdouble(); , my problem is the randoms are correct only in the debug section when it display on gridview but in the run section the first random number is fixed all the time on the gridview doesn't change . is there any solution ??
Asked
Active
Viewed 120 times
1 Answers
0
I assume you create a new Random instance on every call. Keep using one instance and call rand.NextDouble();
on that instance.

Andre
- 1,228
- 11
- 24