NaN support etc.

Ivan Van Laningham ivanlan at pauahtun.org
Wed May 18 17:44:08 EDT 2005


Hi All--

"Martin v. Löwis" wrote:
> 
> Andreas Beyer wrote:
> > How do I find out if NaN, infinity and alike is supported on the current
> > python platform?
> 
> To rephrase Sebastian's (correct) answer: by
> 
> 1. studying the documentation of the CPU vendor
> 2. studying the documentation of the compiler vendor, and performing
>    extensive tests on how the compiler deals with IEEE-754
> 3. studying the documentation of the system's C library, reading
>    its source code (if available), and performing extensive tests
>    of the IEEE-754 support in the C libray
> 4. studying Python's source code (you can spare yourself reading
>    documentation because there is none)
> 
> > Is there an 'official' handle for obtaining this information?
> 
> No.
> 
> > Similar: How do I get the maximum/minimum double for current machine?
> 
> By experimentation, and/or reading vendor documentation.
> 

Something that might help a little is

http://www.pauahtun.org/TYPython/machar.zip

It's C source that you can compile on a unix system, and an .exe for
windows, to probe the limits of the IEEE-754 support on a system.  It's
not set up to show you NaN, but by studying the docs on your particular
system you could modify the code to print stuff like that out, I'd
think.

Metta,
Ivan
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours



More information about the Python-list mailing list