[Numpy-discussion] Does float16 exist?

Charles R Harris charlesr.harris@gmail....
Tue Jan 8 12:13:46 CST 2008

On Jan 7, 2008 1:09 PM, Travis E. Oliphant <oliphant@enthought.com> wrote:

> Darren Dale wrote:
> > One of my collaborators would like to use 16bit float arrays. According
> to
> > http://www.scipy.org/Tentative_NumPy_Tutorial, and references to float16
> in
> > numpy.core.numerictypes, it appears that this should be possible, but
> the
> > following doesnt work:
> >
> No, it's only possible, if the C-implementation NumPy was compiled with
> has 16-bits for its float scalar.
> Only float, double, and long double are implemented.  These translate to
> various bit-widths on different platforms.  numerictypes is overly
> aggressive at guessing what they might translate to.

I'm starting to get interested in implementing float16 support ;) My
tentative program goes something like this:

1) Add the operators to the scalar type. This will give sorting, basic
printing, addition, etc.
2) Add conversions to other types. This will allow promotion of data to
currently supported types.
3) Unoptimized BLAS or ATLAS additions for the type. This would give array
4) Figure out what the precedence relations are.

Can you add some details to this roadmap? It also strikes me that this
exercise can be repeated for quad precision floats, so might be a good
preparation for future IEEE types like the proposed decimal floating types.
Note that we are going to need some way to distinguish quads and extended
precision types on 64bit platforms, as both will both register as float128
in the current notation. Decimal floats can be added with the notation
decimal64, etc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080108/306a09fc/attachment.html 

More information about the Numpy-discussion mailing list