Say I have a variable that is assigned the type 'long'
x = 40*2*10**30
If then I try to take the log of this variable using numpy (imported as np):
np.log10(x)
I encountered an attribute error:
The 'long' object does not have the attribute 'log10'.
To get around this, I can make the variable float, and it works fine or uses the "math" package:
math.log10(x) np.log10(float(x))
My question is: how are math.log10 and np.log10 different, and why is np not configured to handle long types?
source share