Hi,
I try to generate uniform random number between 0 and 1.
I wrote this code but it creates only numbers at the 0.1***.
Generated number always have 0.1 and remaning numbers change,
like 0.1234, 0.13444,0.143334....
Can you show me show how can I generate these numbers (uniformly) at (0,1].
#include <cmath>
#include <iostream>
#include <limits>
#include <cstdlib>
#include <ctime>
using namespace std;
main ()
{
double AOD;
srand((unsigned)time(NULL));
AOD=((double) rand() / (RAND_MAX+1)) ;
cout<<endl<<AOD;
std::cout <<" Press ENTER to continue...";
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
return(0);
}