Don't abbreviate the util::range::rand function
This commit is contained in:
parent
f02501eb5e
commit
2e091079d2
@ -35,10 +35,10 @@ namespace util {
|
||||
template<>
|
||||
colour
|
||||
random (void) {
|
||||
return colour (range<double>::UNIT.rand (),
|
||||
range<double>::UNIT.rand (),
|
||||
range<double>::UNIT.rand (),
|
||||
range<double>::UNIT.rand ());
|
||||
return colour (range<double>::UNIT.random (),
|
||||
range<double>::UNIT.random (),
|
||||
range<double>::UNIT.random (),
|
||||
range<double>::UNIT.random ());
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -28,7 +28,7 @@ namespace util {
|
||||
template <typename T>
|
||||
T
|
||||
random (void)
|
||||
{ return range<T>::UNLIMITED.rand (); }
|
||||
{ return range<T>::UNLIMITED.random (); }
|
||||
|
||||
template <typename T>
|
||||
T&
|
||||
|
@ -76,7 +76,7 @@ range<T>::normalise (T val) const {
|
||||
|
||||
template <typename T>
|
||||
T
|
||||
range<T>::rand (void) const {
|
||||
range<T>::random (void) const {
|
||||
double pos = ::rand () / (double)(RAND_MAX);
|
||||
return (max - min) * pos;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ namespace util {
|
||||
|
||||
/// Return a pseudo-random uniformly distributed value within the range.
|
||||
/// 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
|
||||
|
Loading…
Reference in New Issue
Block a user