Issues with c++ 11 mersenne_twister_engine class

前端 未结 4 1069
谎友^
谎友^ 2021-01-25 11:43

I have been trying to use the c++ 11 mersenne_twister_engine class( http://www.cplusplus.com/reference/random/mersenne_twister_engine/) to generate numbers in the interval [0,1]

4条回答
  •  执念已碎
    2021-01-25 11:58

    Perhaps you are looking for generate_canonical(gen)? This will generate a decimal value uniformly distributed in the interval [0,1) with bits bits of randomness (53 being the standard maximum available for a double).

提交回复
热议问题