diff --git a/pi/models.py b/pi/models.py index 0490748..210d8d9 100644 --- a/pi/models.py +++ b/pi/models.py @@ -59,6 +59,8 @@ class PiLog(models.Model): @property def value(self): """Return this log entry's estimated value of pi.""" + if self.total_count == 0: + return 0.0 return 4.0 * int(self.total_count_inside) / int(self.total_count) @property