I am never going to complain about Python again

Neil Cerutti neilc at norwich.edu
Thu Oct 10 15:54:49 EDT 2013


On 2013-10-10, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:
> On 10 October 2013 18:48, Neil Cerutti <neilc at norwich.edu> wrote:
>> I guess the "if appropriate" part eluded my eye. When *is* it
>> appropriate? Apparently not during an equal test.
>>
>>>>> 5.0 == abs(3 + 4j)
>> False
>
> If the above is genuine output then it's most likely floating point
> error. I wouldn't expect any errors in that though. What version of
> Python are you using and on what OS/hardware?
>
> I get the following in Python 2.7 and 3.2 on Ubuntu 12.04 with a
> 32-bit AMD processor:
>>>> 5.0 == abs(3+4j)
> True

I get the same thing. I was apparently quite confused.

-- 
Neil Cerutti



More information about the Python-list mailing list