[Numpy-discussion] Does float16 exist?

Darren Dale darren.dale@cornell....
Tue Jan 8 14:43:56 CST 2008


On Tuesday 08 January 2008 03:24:49 pm Charles R Harris wrote:
> On Jan 8, 2008 1:09 PM, Anne Archibald <peridot.faceted@gmail.com> wrote:
> > On 08/01/2008, Charles R Harris <charlesr.harris@gmail.com> wrote:
> > > Well, at a minimum people will want to read, write, print, and promote
> >
> > them.
> >
> > > That would at least let people work with the numbers, and since my
> > > understanding is that the main virtue of the format is compactness for
> > > storage and communication, a basic need will be filled right there. One
> > > potential problem I see is handling +/-inf and nans, tests for these
> >
> > should
> >
> > > probably be built into the type.
> >
> > The el-cheapo solution to this simply provides two functions: take an
> > int16 array (which actually contains float16) and produce a float32
> > array, and vice versa. Then people do all their work in float32 (or
> > float64 is float32  doesn't have inf/nan, I don't remember) but can
> > read and write float16.
>
> Sure, but where's the fun in that? Besides, I think that adding a data type
> might be an opportunity to generate a detailed road map for future projects
> that might actually matter (quads and decimal floats for money stuff), and
> might provide a chance to revisit some code and see if it can be
> simplified. It's tough to get up the motivation to do that without some
> other prod. Besides, it's new and I have a weakness for new stuff.
>
> > Of course it would be nicer to use flaot16 natively, more or less, but
> > without all the math that's going to be a frustrating experience.
>
> I would plan on at least arithmetic. Adding special functions probably
> ain't worth it and even now a lot of things are done by promoting things to
> floats or doubles and calling routines in LAPACK.

For what its worth, the people I work with were interested in using float16's 
for their work too (not just storage), but since they are not available, they 
will use float32 and are investigating pytables to cut back on memory and 
disk use.

-- 
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

darren.dale@cornell.edu
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu


More information about the Numpy-discussion mailing list