Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctime>
- #include <cstdlib>
- srand ( time(NULL) ); //just seed the generator
- int r = rand()%4000 - 2000; //this produces numbers between -2000 - +2000
- double random_num = r/10000.0; //this will create random floating point numbers between -0.2 upto //0.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement