How to get a Python long double literal?
<p>How to get a Python long double literal? I have tried with </p>

<pre><code>numpy.longdouble(1e309)
</code></pre>

<p>and </p>

<pre><code>numpy.longdouble("1e309")
</code></pre>

<p>but both of them just return <code>inf</code>. What would be the right way to do that?</p>

<p>[<strong>EDIT</strong>] An answer below says that long double is treated as double in some platform. It is not the case on my system. To show this, I have tried:</p>

<pre><code>np.longdouble(2.0)**1029
</code></pre>

<p>on my system (Mac OS 10.11).  It returns </p>

<pre><code>5.7526180315594109047e+309
</code></pre>

<p>[<strong>EDIT2</strong>] As suggested, I just tried </p>

<pre><code> np.finfo(np.longdouble)
</code></pre>

<p>which gives</p>

<pre><code> finfo(resolution=1e-18, 
       min=-1.18973149536e+4932, 
       max=1.18973149536e+4932, 
       dtype=float128)
</code></pre>

<p>on my OS.  For info, my numpy version is 1.10.1.</p>