来自标题 <random>
, 有一个名为 std::minstd_rand
的引擎.
此引擎随机数的界限是包含还是不包含?它有 min
和 max
功能,但我特别想知道随机模拟是否可以等于min
或 max
,而不是仅仅受其约束。
文档使用了“介于”这个词,这当然不是没有歧义的。
最佳答案
t's got
min
andmax
functions, but I specifically want to know whether the random simulation can equalmin
ormax
.
是的。
来自 https://en.cppreference.com/w/cpp/numeric/random/linear_congruential_engine#Characteristics (强调我的):
min [static]
gets the smallest possible value in the output range (public static member function)
max [static]
gets the largest possible value in the output range (public static member function)
关于c++ - std::minstd_rand 的界限是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52347908/