Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
double RandDouble(double min, double max) {
double rand = (double) RandomGen::GetRand32() / UINT32_MAX;
return (rand * (max - min)) + min;
}
I wrote this function 2 months ago and until now assumed it was working.
Turns out GetRand32 has a range up to INT32_MAX, not UINT32_MAX. So this function would only ever select the first half of the range.
You gotta be fucking kidding me...
undefined
fuck
random
c++