#19304: Fix hash function of rationals
--------------------------+----------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: new
Priority: critical | Milestone: sage-6.9
Component: misc | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
--------------------------+----------------------------
{{{
sage: 1 == hash(2/3) == hash(3/2) == hash(5/4) == hash(4/5) == hash(9/8)
== hash(8/9)
True
}}}
The hash function of rationals is only a xor between numerator and
denominator. As shown above this is too naive to avoid collisions!
--
Ticket URL: <http://trac.sagemath.org/ticket/19304>
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/d/optout.