Don't abbreviate the util::range::rand function

This commit is contained in:
Danny Robson 2011-10-03 19:20:14 +11:00
parent f02501eb5e
commit 2e091079d2
4 changed files with 7 additions and 7 deletions

View File

@ -35,10 +35,10 @@ namespace util {
template<> template<>
colour colour
random (void) { random (void) {
return colour (range<double>::UNIT.rand (), return colour (range<double>::UNIT.random (),
range<double>::UNIT.rand (), range<double>::UNIT.random (),
range<double>::UNIT.rand (), range<double>::UNIT.random (),
range<double>::UNIT.rand ()); range<double>::UNIT.random ());
} }
template <> template <>

View File

@ -28,7 +28,7 @@ namespace util {
template <typename T> template <typename T>
T T
random (void) random (void)
{ return range<T>::UNLIMITED.rand (); } { return range<T>::UNLIMITED.random (); }
template <typename T> template <typename T>
T& T&

View File

@ -76,7 +76,7 @@ range<T>::normalise (T val) const {
template <typename T> template <typename T>
T T
range<T>::rand (void) const { range<T>::random (void) const {
double pos = ::rand () / (double)(RAND_MAX); double pos = ::rand () / (double)(RAND_MAX);
return (max - min) * pos; return (max - min) * pos;
} }

View File

@ -51,7 +51,7 @@ namespace util {
/// Return a pseudo-random uniformly distributed value within the range. /// Return a pseudo-random uniformly distributed value within the range.
/// There are no statistical randomness guarantees whatsoever. /// There are no statistical randomness guarantees whatsoever.
T rand (void) const; T random (void) const;
bool operator ==(const range<T>& rhs) const; bool operator ==(const range<T>& rhs) const;
bool operator !=(const range<T>& rhs) const bool operator !=(const range<T>& rhs) const