Consider these issues of numerical precision:
import numpy as np np.log10(1e-324) # -inf & divide-by-zero np.log10(1e+309) # +inf np.round(x, +308) #