[Numpy-discussion] [Numpy] quadruple precision

Jonathan Rocher jrocher@enthought....
Wed Feb 29 11:13:35 CST 2012


Thanks to your question, I discovered that there is a float128 dtype in
numpy

In[5]: np.__version__
Out[5]: '1.6.1'

In[6]: np.float128?
Type:       type
Base Class: <type 'type'>
String Form:<type 'numpy.float128'>
Namespace:  Interactive
File:
/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/numpy/__init__.py
Docstring:
128-bit floating-point number. Character code: 'g'. C long float
compatible.

Based on some reported issues, it seems like there are issues though with
this and its mapping to python long integer...
http://mail.scipy.org/pipermail/numpy-discussion/2011-October/058784.html

HTH,
Jonathan

On Wed, Feb 29, 2012 at 9:22 AM, Paweł Biernat <pwl_b@wp.pl> wrote:

> I am completely new to Numpy and I know only the basics of Python, to
> this point I was using Fortran 03/08 to write numerical code. However,
> I am starting a new large project of mine and I am looking forward to
> using Python to call some low level Fortran code responsible for most
> of the intensive number crunching. In this context I stumbled into
> f2py and it looks just like what I need, but before I start writing an
> app in mixture of Python and Fortran I have a question about numerical
> precision of variables used in numpy and f2py.
>
> Is there any way to interact with Fortran's real(16) (supported by gcc
> and Intel's ifort) data type from numpy? By real(16) I mean the
> binary128 type as in IEEE 754. (In C this data type is experimentally
> supported as __float128 (gcc) and _Quad (Intel's icc).) I have
> investigated the float128 data type, but it seems to work as binary64
> or binary80 depending on the architecture. If there is currently no
> way to interact with binary128, how hard would it be to patch the
> sources of numpy to add such data type? I am interested only in
> basic stuff, comparable in functionality to libmath.
>
> As said before, I have little knowledge of Python, Numpy and f2py, I
> am however, interested in investing some time in learing it and
> implementing the mentioned features, but only if there is any hope of
> succeeding.
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Jonathan Rocher, PhD
Scientific software developer
Enthought, Inc.
jrocher@enthought.com
1-512-536-1057
http://www.enthought.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120229/ed8091f5/attachment.html 


More information about the NumPy-Discussion mailing list