
#include <boost/random.hpp> #include <iostream> int main(int argc, char *argv[]) { boost::mt19937 eng; boost::normal_distribution<> norm(0,1); std::cout << norm(eng) << std::endl; } Gives me a NaN everytime. Looking at the code, it doesn't really surprise me, as _r1 = eng(); _r2 = eng(); _cached_rho = sqrt(-result_type(2)*log(result_type(1)-_r2)); would only work if eng were in the range (0,1) with 0 being degenerate, and 1 being undefined. Looking through the mt19937, that is returning a full UInt32. Perhaps those two eng() should be replaced by uniform_01? Jeffrey McBeth -- ---------------------------------------------------------------------------- Hofstadter's Law states: It always takes longer than you expect, even when you take into account Hofstadter's Law. ----------------------------------------------------------------------------