Permalink
Browse files

fix FloatGenerator decimal_digits handling

```python
>>> 10 ^ 1
11
>>> 10 ^ 2
8
>>> 10 ** 1
10 
>>> 10 ** 2
100
```
  • Loading branch information...
tumb1er committed Jul 20, 2016
1 parent d38ae8f commit de0fd83cf35af73afdbcc43d1e9dc067acaaeb2a
Showing with 2 additions and 2 deletions.
  1. +2 −2 autofixture/generators.py
@@ -221,9 +221,9 @@ def generate(self):
value = super(FloatGenerator, self).generate()
value = float(value)
if self.decimal_digits:
digits = random.randint(1, 10 ^ self.decimal_digits) - 1
digits = random.randint(1, 10 ** self.decimal_digits) - 1
digits = float(digits)
value = value + digits / (10 ^ self.decimal_digits)
value = value + digits / (10 ** self.decimal_digits)
return value

0 comments on commit de0fd83

Please sign in to comment.