C++: generate gaussian distribution
问题 I would like to know if in C++ standard libraries there is any gaussian distribution number generator, or if you have any code snippet to pass. Thanks in advance. 回答1: The standard library does not. Boost.Random does, however. I'd use that if I were you. 回答2: C++ Technical Report 1 adds support for random number generation. So if you're using a relatively recent compiler (visual c++ 2008 GCC 4.3), chances are that it is available out of the box. See here for sample usage of std::tr1::normal