ValueError: invalid literal for float(): -1.#IND (pickle.py)

Grant Edwards invalid at invalid.invalid
Mon Jul 12 10:54:25 EDT 2010


On 2010-07-12, Grant Edwards <invalid at invalid.invalid> wrote:
> On 2010-07-12, Alexander Eisenhuth <newsuser at stacom-software.de> wrote:
>
>> python: 2.5.1
>> palttform: winXP
>>
>> I'm using pickle.dump and pickle.load with data that is created in a
>> wrapped (boost.python) piece of C++ code. pickle.dump works fine.
>> pickle.load creates the following exception:
>>
>> [...]
>>      data = pickle.load(input)
>>    File "C:\Python25\lib\pickle.py", line 1370, in load
>>      return Unpickler(file).load()
>>    File "C:\Python25\lib\pickle.py", line 858, in load
>>      dispatch[key](self)
>>    File "C:\Python25\lib\pickle.py", line 954, in load_float
>>      self.append(float(self.readline()[:-1]))
>> ValueError: invalid literal for float(): -1.#IND
>>
>> - I'm not sure what -1.#IND means.
>
> That's an infinity.

Oops, I just noticed that I misread that.  1.#INF is an infinity,
1.#IND is an "indefinite", or what everybody outside of Microsoft
calls a NaN (Not-a-Number).

-- 
Grant Edwards               grant.b.edwards        Yow! ONE LIFE TO LIVE for
                                  at               ALL MY CHILDREN in ANOTHER
                              gmail.com            WORLD all THE DAYS OF
                                                   OUR LIVES.



More information about the Python-list mailing list