diff --git a/mhcflurry/antigen_presentation/percent_rank_transform.py b/mhcflurry/antigen_presentation/percent_rank_transform.py
index 5d729f1c60a0ef23bf9b9a592014ce16123741c3..1895635cf8fe4cf57fbd2decd88c7a097a4b4205 100644
--- a/mhcflurry/antigen_presentation/percent_rank_transform.py
+++ b/mhcflurry/antigen_presentation/percent_rank_transform.py
@@ -24,7 +24,7 @@ class PercentRankTransform(object):
         self.cdf[0] = 0.0
         self.cdf[1] = 0.0
         self.cdf[-1] = 100.0
-        numpy.cumsum(hist / numpy.sum(hist) * 100.0, out=self.cdf[2:-1])
+        numpy.cumsum(hist * 100.0 / numpy.sum(hist), out=self.cdf[2:-1])
         assert not numpy.isnan(self.cdf).any()
 
     def transform(self, values):
diff --git a/test/test_antigen_presentation.py b/test/test_antigen_presentation.py
index 16d31bc0b688072d1327089209390885f2547edd..d46d0f8b620ce6f5c52a34ff2e380e0a41841a4e 100644
--- a/test/test_antigen_presentation.py
+++ b/test/test_antigen_presentation.py
@@ -1,7 +1,7 @@
 from nose.tools import eq_, assert_less
 
 import numpy
-from numpy.testing import assert_almost_equal
+from numpy.testing import assert_allclose
 import pandas
 from mhcflurry import amino_acid
 from mhcflurry.antigen_presentation import (
@@ -76,9 +76,10 @@ del HITS_DF["hit"]
 def test_percent_rank_transform():
     model = percent_rank_transform.PercentRankTransform()
     model.fit(numpy.arange(1000))
-    assert_almost_equal(
+    assert_allclose(
         model.transform([-2, 0, 50, 100, 2000]),
-        [0.0, 0.0, 5.0, 10.0, 100.0])
+        [0.0, 0.0, 5.0, 10.0, 100.0],
+        err_msg=str(model.__dict__))
 
 
 def test_mhcflurry_trained_on_hits():