c++ - Using boost for (pseudo-)random number generator of long double -


i'm trying use boost random number generation of long double (on 64bits machine).

at point use

rng = boost::mt19937(); 

however, compiler argues on line 88 of boost/random/mersenne_twister.hpp,

x[i] = (1812433253ul * (x[i-1] ^ (x[i-1] >> (w-2))) + i) & mask; 

there implicit conversion shortens 64-bit 32-bit value...

i didn't specified if want long double or double... why arguing on that? because i'm using 64bits os?

is there simple solution problem? need long double generator... xd

thanks

the mt19937 32bit. defined in boost like

typedef mersenne_twister_engine<uint32_t,32,624,397,31,0x9908b0df, 11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253> mt19937; 

for 64bit necessary use mt19937_64.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -