diff --git a/src/utility/random.cpp b/src/utility/random.cpp index 7a7161af..15b13ee2 100644 --- a/src/utility/random.cpp +++ b/src/utility/random.cpp @@ -35,10 +35,7 @@ const unsigned int random::getNext() // Park and Miller's minimal standard generator: // xn+1 = (a * xn + b) mod c // xn+1 = (16807 * xn) mod (2^31 - 1) - static const unsigned long a = 16807; - static const unsigned long c = (1 << ((sizeof(int) << 3) - 1)); - - m_next = static_cast((a * m_next) % c); + m_next = static_cast((16807 * m_next) % 2147483647ul); return (m_next); }