Faker C++
|
Functions | |
FAKER_CXX_EXPORT bool | boolean () |
Returns a random boolean. | |
FAKER_CXX_EXPORT bool | boolean (double probability) |
Returns a random boolean. **Note:** A probability of `0.75` results in `true` being returned `75%` of the calls; likewise `0.3` => `30%`. If the probability is `<= 0.0`, it will always return `false`. If the probability is `>= 1.0`, it will always return `true`. The probability is limited to two decimal places. | |
FAKER_CXX_EXPORT bool faker::datatype::boolean | ( | ) |
FAKER_CXX_EXPORT bool faker::datatype::boolean | ( | double | probability | ) |
Returns a random boolean. **Note:** A probability of `0.75` results in `true` being returned `75%` of the calls; likewise `0.3` => `30%`. If the probability is `<= 0.0`, it will always return `false`. If the probability is `>= 1.0`, it will always return `true`. The probability is limited to two decimal places.
probability | The probability (`[0.00, 1.00]`) of returning `true`. |