How to get Python long double literal? I tried with
numpy.longdouble(1e309)
and
numpy.longdouble("1e309")
but both of them just return inf . What would be the right way to do this?
[ EDIT ]. The answer below says that a long double is considered double in some platform. On my system, this is not the case. To show this, I tried:
np.longdouble(2.0)**1029
on my system (Mac OS 10.11). He returns
5.7526180315594109047e+309
[ EDIT2 ] Like I said, I just tried
np.finfo(np.longdouble)
which gives
finfo(resolution=1e-18, min=-1.18973149536e+4932, max=1.18973149536e+4932, dtype=float128)
in my OS. For information, my numpy version is 1.10.1.
source share