diff --git a/numcodecs/quantize.py b/numcodecs/quantize.py index b5b6cc3c..329a6d3d 100644 --- a/numcodecs/quantize.py +++ b/numcodecs/quantize.py @@ -65,9 +65,9 @@ def encode(self, buf): precision = 10.0**-self.digits exp = math.log10(precision) if exp < 0: - exp = int(math.floor(exp)) + exp = math.floor(exp) else: - exp = int(math.ceil(exp)) + exp = math.ceil(exp) bits = math.ceil(math.log2(10.0**-exp)) scale = 2.0**bits enc = np.around(scale * arr) / scale