#! 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 <[EMAIL PROTECTED]> Subject: Re: NaN support etc. X-Nntp-Posting-Host: cola2.ca.boeing.com Content-Type: text/plain; charset=iso-8859-1 Message-ID: <[EMAIL PROTECTED]> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Lines: 38 Sender: [EMAIL PROTECTED] Content-Transfer-Encoding: 8bit Organization: The Boeing Company References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]> 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? -- [EMAIL PROTECTED] 6-6M21 BCA CompArch Design Engineering Phone: (425) 294-4718
-- http://mail.python.org/mailman/listinfo/python-list