Fixed warning.
This commit is contained in:
parent
15b93aaa59
commit
b90ca5481d
@ -35,10 +35,7 @@ const unsigned int random::getNext()
|
|||||||
// Park and Miller's minimal standard generator:
|
// Park and Miller's minimal standard generator:
|
||||||
// xn+1 = (a * xn + b) mod c
|
// xn+1 = (a * xn + b) mod c
|
||||||
// xn+1 = (16807 * xn) mod (2^31 - 1)
|
// xn+1 = (16807 * xn) mod (2^31 - 1)
|
||||||
static const unsigned long a = 16807;
|
m_next = static_cast<unsigned int>((16807 * m_next) % 2147483647ul);
|
||||||
static const unsigned long c = (1 << ((sizeof(int) << 3) - 1));
|
|
||||||
|
|
||||||
m_next = static_cast<unsigned int>((a * m_next) % c);
|
|
||||||
return (m_next);
|
return (m_next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user