We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62f83c1 commit 1c8d8eeCopy full SHA for 1c8d8ee
numcodecs/quantize.py
@@ -63,12 +63,12 @@ def encode(self, buf):
63
64
# apply scaling
65
precision = 10.0**-self.digits
66
- exp = math.log(precision, 10)
+ exp = math.log10(precision)
67
if exp < 0:
68
exp = int(math.floor(exp))
69
else:
70
exp = int(math.ceil(exp))
71
- bits = math.ceil(math.log(10.0**-exp, 2))
+ bits = math.ceil(math.log2(10.0**-exp))
72
scale = 2.0**bits
73
enc = np.around(scale * arr) / scale
74
0 commit comments