
18 Mar
2006
18 Mar
'06
1:54 p.m.
This seems to be dependant on the type of generator you use. Try using lagged_fibonacci. The casting and dividing involved in uniform_real appears to loose a lot of accuracy, but lagged_fibonacci generates doubles between 0 and 1, so there's no cast and it's dividing by 1.
Just a quick update for those who are interested: using lagged_fibonacci does indeed solve the problem and allows the iostreams code I posted earlier to detect the VC8 streaming problem. Unfortunately lagged_fibonacci isn't part of TR1: the only real number generator that is (subtract_with_carry_01) appears to still leave the final 4 bits as zero :-( John.