[Python-Dev] Re: marshal / unmarshal
"Martin v. Löwis"
martin at v.loewis.de
Sat Apr 9 15:32:06 CEST 2005
Skip Montanaro wrote:
> Martin> Yet, this *still* is a platform dependence. Python makes no
> Martin> guarantee that 1e1000 is a supported float literal on any
> Martin> platform, and indeed, on your platform, 1e1000 is not supported
> Martin> on your platform.
>
> Are float("inf") and float("nan") supported everywhere?
I would not expect that, but Tim will correct me if I'm wrong.
> As a starting point can it be agreed on whether they
> should be supported? (There is a unique IEEE-754 representation for both
> values, right?
Perhaps yes for inf, but I think maybe no for nan. There are multiple
IEEE-754 representations for NaN. However, I understand all NaN are
meant to compare unequal - even if they use the same representation.
> If so, the float("1e10000") == float("inf") in all cases, right?
Currently, not necessarily: if a large-enough exponent is supported
(which might be the case with a IEEE "long double", dunno), 1e10000
would be a regular value.
> That seems like it would be a start in the right direction.
Pieces of it would be a start in the right direction.
Regards,
Martin
More information about the Python-Dev
mailing list