[Python-Dev] A Horrible Inconsistency
Georg Brandl
g.brandl at gmx.net
Fri May 26 18:00:19 CEST 2006
Fredrik Lundh wrote:
> Sean Reifschneider wrote:
>
>>> - Treat the negative as a reverser, so we get back (3, 2, 1).
>>
>> Then we could get:
>>
>> >>> print -123
>> 321
>>
>> Yay!
>
> and while we're at it, let's fix this:
>
> >>> 0.66 * (1, 2, 3)
> (1, 2)
>
> and maybe even this
>
> >>> 0.5 * (1, 2, 3)
> (1, 1)
>
> but I guess the latter one might need a pronunciation.
No, no, no! Floating point is so inaccurate! It has to be
>>> Decimal("0.5") * (1, 2, 3)
(1, Decimal("1"))
Georg
More information about the Python-Dev
mailing list