Uniform
Create a new Uniform distribution
Uniform X = Uniform(a, b); Distribution properties:
Property
Type/Return type
Description
Example
//Example: for a range [2, 5], whats the probability of getting the number 3?
double a = 2; //min. of range
double b = 5; //max. of range
Uniform X = Uniform(a, b);
std::cout << X.P(3) << std::endl; //0.333333Uniform X = Uniform(5, 10);
std::cout << X.P(11) << std::endl; //Error: Given value cannot be anything outside of [a, b]. Last updated