Don't abbreviate the util::range::rand function
This commit is contained in:
parent
f02501eb5e
commit
2e091079d2
@ -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 <>
|
||||||
|
@ -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&
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user