I'm trying to solve a numerical maths problem, and for that I need python to handle very small numbers. For that, I installed mpmath.
It doesn't quite work as desired though.
Mpmath is able to handle 1e-300 but not 1e-400 (10^-300 but not 10^-400 respectively)
In the head I have
from mpmath import mp
from mpmath import mpf
mp.dps = 500
If I type
x = mpf(1e-300)
print(x)
I get a thousand digit number, that is close to 1e-300 (which is what I want)
However, if I now type
y = mpf(1e-400)
print(y)
I get the result: 0.0
, which is not what I want.
I tried to ramp up the decimal precision (e.g. mp.dps = 3000) but it didn't help, I still got zero in the second case.
Is there a way to circumvent this, or is mpmath just unable to do handle 1e-400?