Faker C++
Loading...
Searching...
No Matches
datatype.h File Reference
#include "faker-cxx/export.h"
Include dependency graph for datatype.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  faker
 
namespace  faker::datatype
 

Functions

FAKER_CXX_EXPORT bool faker::datatype::boolean ()
 Returns a random 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.