On Nov 28, 11:14 pm, Mark Dickinson <dicki...@gmail.com> wrote:
> While that's true, I think the implementation of Python is
> such that the Python objects -0 and 0 should always be
> indistinguishable even on machines where the underlying
> architecture represents integers using ones' complement or
> sign-magnitude.

Hmm.  I really should think before posting.  A quick glance
at int_and, int_xor and int_or in Objects/intobject.c:

http://svn.python.org/view/python/trunk/Objects/intobject.c?view=markup

shows that Python clearly fails to be independent of the
hardware's choice of integer representation.  E.g., on a
ones' complement machine, Python would give:

>>> -1 & 1
0

but the same operation on longs would give a different
result:

>>> -1L & 1L
1L

Mark
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to