#include <iostream>
#include <random>
using namespace std;
float randFloat(int hi = 0, int lo = 0){
if(hi == 0){
//random number in [0,1)
return static_cast <float> (rand()) / static_cast <float> (RAND_MAX);
}else if(lo == 0){
//random number in [0,hi)
return static_cast <float> (rand()) / (static_cast <float> (RAND_MAX/hi));
}else{
//random number in [lo, hi)
return lo + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(hi-lo)));
}
}