The output of mpmath.gamma in python function prints the values in this way like:
mpf('1.7780824344856125e-342')
How to extract the value or just printing the value like this:
y=1.7780824344856125e-342
if I use float(y) it gives zero.
The output of mpmath.gamma in python function prints the values in this way like:
mpf('1.7780824344856125e-342')
How to extract the value or just printing the value like this:
y=1.7780824344856125e-342
if I use float(y) it gives zero.
Learning is a mess
On
As explained by Tino D the issue is that 1.77808e-342 is smaller than the smallest positive double precision float (the default python floating number container). You can check it with the numpy utils:
np.finfo(np.float64).tiny
# 2.2250738585072014e-308
which explains why it gets rounded down to 0. There are no double numbers between 0 and ~1e-308 and your very tiny number sits in that interval. When you cast it to a double, it gets "rounded down" to 0, hence your observation.
For me this is working fine:
Results:
Now I am not sure if you can represent this kind of value as a floating point. It has to do with the limits of these data types. For more reference, check this: https://en.wikipedia.org/wiki/IEEE_754