rand/xorshift: throw on zero seed
zero seeds are a hard runtime error which shouldn't be compiled out in release mode.
This commit is contained in:
parent
f741986c3f
commit
138cac23fe
@ -28,8 +28,8 @@ template <typename T>
|
||||
xorshift<T>::xorshift (T seed):
|
||||
m_state (seed)
|
||||
{
|
||||
// state must not be zero, or the period will be zero.
|
||||
CHECK_NEZ (m_state);
|
||||
if (!m_state)
|
||||
throw std::invalid_argument ("xorshift seed must not be zero");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user