<br><br><div class="gmail_quote">On Sun, Nov 13, 2011 at 12:57 AM, Matthew Brett <span dir="ltr"><<a href="mailto:matthew.brett@gmail.com">matthew.brett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<div class="im"><br>
On Sat, Nov 12, 2011 at 11:35 PM, Matthew Brett <<a href="mailto:matthew.brett@gmail.com">matthew.brett@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> Sorry for my continued confusion here.  This is numpy 1.6.1 on windows<br>
> XP 32 bit.<br>
><br>
> In [2]: np.finfo(np.float96).nmant<br>
> Out[2]: 52<br>
><br>
> In [3]: np.finfo(np.float96).nexp<br>
> Out[3]: 15<br>
><br>
> In [4]: np.finfo(np.float64).nmant<br>
> Out[4]: 52<br>
><br>
> In [5]: np.finfo(np.float64).nexp<br>
> Out[5]: 11<br>
><br>
> If there are 52 bits of precision, 2**53+1 should not be<br>
> representable, and sure enough:<br>
><br>
> In [6]: np.float96(2**53)+1<br>
> Out[6]: 9007199254740992.0<br>
><br>
> In [7]: np.float64(2**53)+1<br>
> Out[7]: 9007199254740992.0<br>
><br>
> If the nexp is right, the max should be higher for the float96 type:<br>
><br>
> In [9]: np.finfo(np.float64).max<br>
> Out[9]: 1.7976931348623157e+308<br>
><br>
> In [10]: np.finfo(np.float96).max<br>
> Out[10]: 1.#INF<br>
><br>
> I see that long double in C is 12 bytes wide, and double is the usual 8 bytes.<br>
<br>
</div>Sorry - sizeof(long double) is 12 using mingw.  I see that long double<br>
is the same as double in MS Visual C++.<br>
<br>
<a href="http://en.wikipedia.org/wiki/Long_double" target="_blank">http://en.wikipedia.org/wiki/Long_double</a><br>
<br>
but, as expected from the name:<br>
<br>
In [11]: np.dtype(np.float96).itemsize<br>
Out[11]: 12<br>
<br></blockquote><div><br>Hmm, good point. There should not be a float96 on Windows using the MSVC compiler, and the longdouble types 'gG' should return float64 and complex128 respectively. OTOH, I believe the mingw compiler has real float96 types but I wonder about library support. This is really a build issue and it would be good to have some feedback on what different platforms are doing so that we know if we are doing things right.<br>
<br>Chuck<br></div><br></div>