#10161: AlgebraicNumber comparisons wrong/fail
---------------------------------+--------------------
       Reporter:  vbraun         |         Owner:  was
           Type:  defect         |        Status:  new
       Priority:  major          |     Milestone:
      Component:  number theory  |    Resolution:
       Keywords:                 |     Merged in:
        Authors:                 |     Reviewers:
Report Upstream:  N/A            |   Work issues:
         Branch:                 |  Dependencies:
       Stopgaps:                 |
---------------------------------+--------------------

Comment (by mhansen):

 The issue is actually:

 {{{
 sage: map(hash, (x,y,z))
 [1, 1, -3730706066237751940]
 }}}

 If two things have the same hash and compare equal, then they are the same
 as far as dictionaries are concerned:

 {{{
 sage: d = {}
 sage: d[x] = x
 sage: d[y] = y
 sage: len(d)
 1
 sage: id(y)
 110133424
 sage: id(d[x])
 110133424
 }}}

 One fix would be to change the hash of rational numbers.  Although, I
 think their hash function was designed to be consistent with the integers.

--
Ticket URL: <http://trac.sagemath.org/ticket/10161#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to