   Linear Congruency != 0
  I just realised something... a linear congruency generator can never generate a value of 0 without killing itself (when c == 0 of course, which all implementations that I know of use)So, would it be mathematically sound to quietly "subtract one" from the result of a LCRNG?for example:   template<typename type, type modulus, type multiplier>struct linear_congruency {    linear_congruency( type p_seed = 1 )   : m_seed( p_seed )    {  /* do nothing */ }    void seed( type p_seed = 1 ) { m_seed = p_seed; }    type minimum() { return 0; }    type maximum() { return modulus - 2; }    type operator()() {   m_seed = (multiplier * m_seed) % modulus;   return m_seed - 1;    }protected:    type m_seed;};obviously min/max are considered inclusive values. Technically I don''t see anything wrong with this method. Does anyone else? 
quote:Original post by Mithrandir  (when c == 0 of course, which all implementations that I know of use)   Interesting. I have never seen an implemenation that uses c = 0. I don''t think it''s a good idea. ;  hmmm; it appears boost has steered me wrong.All of the LCG''s that boost has by default use c=0, but now, looking at the source for GCC and Win32, they use c!=0.Interesting.Anyway, does anyone know of any good LCG values to use for a 64-bit RNG? 