diff options
Diffstat (limited to 'docs/fuzzy.rst')
-rw-r--r-- | docs/fuzzy.rst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/fuzzy.rst b/docs/fuzzy.rst index 582a654..1843920 100644 --- a/docs/fuzzy.rst +++ b/docs/fuzzy.rst @@ -97,6 +97,41 @@ FuzzyInteger .. attribute:: high int, the inclusive higher bound of generated integers + +FuzzyDecimal +------------ + +.. class:: FuzzyDecimal(low[, high]) + + The :class:`FuzzyDecimal` fuzzer generates random integers within a given + inclusive range. + + The :attr:`low` bound may be omitted, in which case it defaults to 0: + + .. code-block:: pycon + + >>> FuzzyDecimal(0.5, 42.7) + >>> fi.low, fi.high + 0.5, 42.7 + + >>> fi = FuzzyDecimal(42.7) + >>> fi.low, fi.high + 0.0, 42.7 + + >>> fi = FuzzyDecimal(0.5, 42.7, 3) + >>> fi.low, fi.high, fi.precision + 0.5, 42.7, 3 + + .. attribute:: low + + decimal, the inclusive lower bound of generated decimals + + .. attribute:: high + + decimal, the inclusive higher bound of generated decimals + + .. attribute:: precision + int, the number of digits to generate after the dot. The default is 2 digits. FuzzyDate |