c++ - std::minstd_rand 的界限是什么?

标签 c++ random

来自标题 <random> , 有一个名为 std::minstd_rand 的引擎.

此引擎随机数的界限是包含还是不包含?它有 minmax功能,但我特别想知道随机模拟是否可以等于minmax ,而不是仅仅受其约束。

文档使用了“介于”这个词,这当然不是没有歧义的。

最佳答案

t's got min and max functions, but I specifically want to know whether the random simulation can equal min or max.

是的。

来自 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/

相关文章:

java - 如何根据多个变量制作随机二维数组?

c++ - CMake:外部项目的依赖

特定比例的随机分割文件

c++ - 在 C++ 中记录 SEH 错误

c++ - Qt中如何实现快捷输入框

java - java随机字符串数组

html - 包括网格系统以包括表 - Bootstrap

javascript - 在 JavaScript Math.Floor((Math.Random() * 1) + 0) 中得到 1 的概率

c++ - 如何在 Visual Studio 中自动缩进#pragma 指令

c++ - 如何加载 MP3 或类似的音乐文件以在 wxWidgets 中显示和分析?