struct doesn't handle NaN values?

Grant Edwards grante at visi.com
Thu May 13 18:12:10 EDT 2004


On 2004-05-13, John Roth <newsgroups at jhrothjr.com> wrote:

>> Which part of the C library is broken?
>
> Which C library?

That's what I'm asked?  I was told the C library was broken. I
wanted to know what C library.

> Python runs on 20 different systems, many of which have
> multiple operating systems, each of which has its own C
> library with its own problems. It's not even a standards
> issue: the older standards didn't specify what the C library's
> conversion routines should do.

I presumed that struct was doing the conversion itself.  The
doc specified IEEE format, it would have to do it's own
conversion since it couldn't assume that the host used IEEE
format, and as you say, there's no portable library support
that can be relied upon.

> I referred you to PEP 754 for a reason. That PEP contains
> a thorough discussion of the issues in the treatment of special
> values in Python floating point.
>
> http://www.python.org/peps/pep-0754.html
>
> It also contains a reference to a module that handles
> the matter.

I read it.  It only handles double-precision values, and I'm
working with single-precision values.

-- 
Grant Edwards                   grante             Yow!  I just had my entire
                                  at               INTESTINAL TRACT coated
                               visi.com            with TEFLON!



More information about the Python-list mailing list