This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author anthonydoggett
Recipients
Date 2001-07-28.15:21:02
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Support for float('inf') still appears to be missing in

Python 2.1.1 (#1, Jul 28 2001, 14:15:01) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)]
on linux2

>>> cPickle.dumps(float('inf'), 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SystemError: frexp() result out of range
>>> pickle.dumps(float('inf'), 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/var/ajd111/python/lib/python2.1/pickle.py",
line 943, in dumps
    Pickler(file, bin).dump(object)
  File "/var/ajd111/python/lib/python2.1/pickle.py",
line 109, in dump
    self.save(object)
  File "/var/ajd111/python/lib/python2.1/pickle.py",
line 211, in save
    f(self, object)
  File "/var/ajd111/python/lib/python2.1/pickle.py",
line 273, in save_float
    self.write(BINFLOAT + pack('>d', object))
SystemError: frexp() result out of range


Both structmodule.c and cPickle.c require changes.
Surely something like 

  if (x == HUGE_VAL) {    /* Inf */
      e = 1024;
      f = 0.0;
  }
  else {
      f = frexp(x, &e);
      ...

and

  if (e == 1024)
      x = HUGE_VAL;		/* Inf */
  else {

is all that is required for all IEEE754 machines?

(structmodule.c requires similar changes for Float
also)
History
Date User Action Args
2007-08-23 16:01:19adminlinkissue445484 messages
2007-08-23 16:01:19admincreate