[Python-Dev] Caching float(0.0)

"Martin v. Löwis" martin at v.loewis.de
Tue Oct 3 21:37:53 CEST 2006

Nick Maclaren schrieb:
>> py> x=-0.0
>> py> y=0.0
>> py> x,y
> Nobody is denying that SOME C90 implementations distinguish them,
> but it is no part of the standard - indeed, a C90 implementation is
> permitted to use ANY criterion for deciding when to display -0.0 and
> 0.0.  C99 is ambiguous to the point of internal inconsistency, except
> when __STDC_IEC_559__ is set to 1, though the intent is clear.
> And my reading of Python's code is that it relies on C's handling
> of such values.

So what is your conclusion? That applications will not break?

People don't care that their code may break on a different platform,
if they aren't using these platforms.
They care if it breaks on their platform just because they use a
new Python version.

(Of course, they sometimes also complain that Python behaves
differently on different platforms, and cannot really accept
the explanation that the language didn't guarantee the same
behavior on all systems. This explanation doesn't help them:
they still need to modify the application).


More information about the Python-Dev mailing list