No subject


Thu May 19 09:35:02 EDT 2005


#! rnews 1636
Newsgroups: comp.lang.python
Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!newsfeeder.wxs.nl!textfeed1.on.meganewsservers.com!meganewsservers.com!feeder2.on.meganewsservers.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp
From: Harry George <harry.g.george at boeing.com>
Subject: Re: NaN support etc.
X-Nntp-Posting-Host: cola2.ca.boeing.com
Content-Type: text/plain; charset=iso-8859-1
Message-ID: <xqxwtpvjr2f.fsf at cola2.ca.boeing.com>
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4
Lines: 38
Sender: hgg9140 at cola2.ca.boeing.com
Content-Transfer-Encoding: 8bit
Organization: The Boeing Company
References: <mailman.160.1116438390.8733.python-list at python.org> <428ba190$0$7687$9b622d9e at news.freenet.de> <1116449707.021063.132500 at g44g2000cwa.googlegroups.com>
Mime-Version: 1.0
Date: Thu, 19 May 2005 13:14:32 GMT
Xref: news.xs4all.nl comp.lang.python:378109

"Sébastien Boisgérault" <Sebastien.Boisgerault at gmail.com> writes:

> Martin v. Löwis a écrit :
> > Andreas Beyer wrote:
> > > How do I find out if NaN, infinity and alike is supported on the
> current
> > > python platform?
[snip]
> 
> But, practically, I have never found a platform where
> the following fpconst-like code did not work:
> 
>     import struct
>     cast = struct.pack
> 
>     big_endian = cast('i',1)[0] != '\x01'
>     if big_endian:
>        nan = cast('d', '\x7F\xF8\x00\x00\x00\x00\x00\x00')[0]
>     else:
>        nan = cast('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0]
> 
> Can anybody provide an example of a (not too old or
> exotic) platform where this code does not behave as
> expected ?
> 
> Cheers,
> 
> SB
> 

I use fpconst too.  I've been concerned that its source home seems to
wander.  Any chance of it being added to the base distro?


-- 
harry.g.george at boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 294-4718



More information about the Python-list mailing list