diff --git a/adaptive/learner/average_learner.py b/adaptive/learner/average_learner.py
index ba7deb1..b571c19 100644
--- a/adaptive/learner/average_learner.py
+++ b/adaptive/learner/average_learner.py
@@ -118,9 +118,11 @@ class AverageLearner(BaseLearner):
         if n < self.min_npoints:
             return np.inf
         standard_error = self.std / sqrt(n)
-        return max(
-            standard_error / self.atol, standard_error / abs(self.mean) / self.rtol
-        )
+        aloss = standard_error / self.atol
+        rloss = standard_error / self.rtol
+        if self.mean != 0:
+            rloss /= abs(self.mean)
+        return max(aloss, rloss)
 
     def _loss_improvement(self, n):
         loss = self.loss()

diff --git a/adaptive/tests/test_average_learner.py b/adaptive/tests/test_average_learner.py
index 42d4726..f35794a 100644
--- a/adaptive/tests/test_average_learner.py
+++ b/adaptive/tests/test_average_learner.py
@@ -59,3 +59,11 @@ def test_min_npoints():
         )
         simple(learner, lambda l: l.loss() < 1)
         assert learner.npoints >= max(2, min_npoints)
+
+
+def test_zero_mean():
+    # see https://github.com/python-adaptive/adaptive/issues/275
+    learner = AverageLearner(None, rtol=0.01)
+    learner.tell(0, -1)
+    learner.tell(1, 1)
+    learner.loss()

AverageLearner doesn't work with 0 mean
```python
from adaptive import AverageLearner

l = AverageLearner(None, rtol=0.01)
l.tell(0, -1)
l.tell(1, 1)
l.ask(1)
```
raises
```
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-9-03494c6327ae> in <module>
      4 l.tell(0, -1)
      5 l.tell(1, 1)
----> 6 l.ask(1)

~/Work/adaptive/adaptive/learner/average_learner.py in ask(self, n, tell_pending)
     67             )[:n]
     68 
---> 69         loss_improvements = [self._loss_improvement(n) / n] * n
     70         if tell_pending:
     71             for p in points:

~/Work/adaptive/adaptive/learner/average_learner.py in _loss_improvement(self, n)
    119 
    120     def _loss_improvement(self, n):
--> 121         loss = self.loss()
    122         if np.isfinite(loss):
    123             return loss - self.loss(n=self.npoints + n)

~/Work/adaptive/adaptive/utils.py in wrapper(*args, **kwargs)
     35         if not hasattr(self, "_cache"):
     36             self._cache = {}
---> 37         self._cache[f.__name__] = f(*args, **kwargs)
     38         return self._cache[f.__name__]
     39 

~/Work/adaptive/adaptive/learner/average_learner.py in loss(self, real, n)
    115         standard_error = self.std / sqrt(n)
    116         return max(
--> 117             standard_error / self.atol, standard_error / abs(self.mean) / self.rtol
    118         )
    119 

ZeroDivisionError: float division by zero
```

@akhmerov, how do you think we should solve this?
adaptive/tests/test_average_learner.py::test_zero_mean
adaptive/tests/test_average_learner.py::test_avg_std_and_npoints adaptive/tests/test_average_learner.py::test_min_npoints adaptive/tests/test_average_learner.py::test_only_returns_new_points