New float double and long double random gen functions. more comments

This commit is contained in:
2018-08-18 22:48:33 -04:00
parent a815367c9d
commit 30416b0334
10 changed files with 26 additions and 14 deletions
@@ -45,4 +45,14 @@ const unsigned long int cRandom::Rand( const unsigned long int max, const unsign
const float cRandom::Rand( const float max, const float min /*= 0.0f*/ ) const
{
return (float)((max - min) * rand()/(float)RAND_MAX + min);
}
}
const double cRandom::Rand(const double max, const double min) const
{
return (double)((max - min) * rand() / (double)RAND_MAX + min);
}
const long double cRandom::Rand(const long double max, const long double min) const
{
return (long double)((max - min) * rand() / (long double)RAND_MAX + min);
}