#11854: Fix conversion QQ -> PARI
--------------------------+-------------------------------------------------
   Reporter:  jdemeyer    |          Owner:  was           
       Type:  defect      |         Status:  needs_review  
   Priority:  major       |      Milestone:  sage-4.7.3    
  Component:  interfaces  |       Keywords:                
Work_issues:              |       Upstream:  N/A           
   Reviewer:              |         Author:  Jeroen Demeyer
     Merged:              |   Dependencies:  #11611, #11685
--------------------------+-------------------------------------------------
Changes (by jdemeyer):

  * dependencies:  #11685 => #11611, #11685


Old description:

> Same problem as #11611 but for `QQ` instead of `ZZ`::
> {{{
> sage: foo = pari(2^(32*1024));
> sage: hash(pari(QQ(1)))
> -8646911284551352313
> sage: foo = pari(0xDEADBEEF * (2^(32*1024)-1)//(2^32 - 1));
> sage: hash(pari(QQ(1)))
> -5476377146882523129
> }}}

New description:

 Same problem as #11611 but for `QQ` instead of `ZZ`, the hash of an
 element depends on previous garbage on the PARI stack.  This is because
 the conversion QQ->PARI is not done properly.
 {{{
 sage: foo = pari(2^(32*1024));
 sage: hash(pari(QQ(1)))
 -8646911284551352313
 sage: foo = pari(0xDEADBEEF * (2^(32*1024)-1)//(2^32 - 1));
 sage: hash(pari(QQ(1)))
 -5476377146882523129
 }}}

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11854#comment:6>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to