On Tue, 16 Feb 2010 12:41:31 William Stein wrote:
> On Mon, Feb 15, 2010 at 3:09 PM, François Bissey
> 
> <f.r.bis...@massey.ac.nz> wrote:
> > On Tue, 16 Feb 2010 10:40:11 William Stein wrote:
> >> > sage -t  "devel/sage/doc/en/tutorial/tour_numtheory.rst"
> >> > **********************************************************************
> >> > File "/opt/sage/devel/sage/doc/en/tutorial/tour_numtheory.rst", line
> >> > 94: sage: x = crt(2, 1, 3, 5); x
> >> > Expected:
> >> >    -4
> >> > Got:
> >> >    11
> >>
> >> The above two are because you are using GMP instead of MPIR.
> >
> > So you are saying we need to link against the mpir version of the gmp
> > libraries and that linking against gmp ones produces this result.
> 
> If you link against mpir then the above discrepancy would go away.
> However, i can also tell you that the above discrepancy is harmless.
> The issue is simply that both answers are right.  e.g., the line
> 
>  sage: x = crt(2, 1, 3, 5); x
> 
> uses the Chinese Remainder Theorem to find an integer x such that x %
> 3 == 2 and x%5 == 1.   Both -4 and 11 are correct choices of x.
> The other related tests involving "modular symbols" are different
> because of the same function.
> 

I thought it was the case, and I remember patching xgcd in gmp for
sage-3.0, I guess gmp hasn't step up that one yet, at least in the gmp-4
releases. May be it is in for gmp-5, we could force it if that solved the
problem.

> > I guess a finer point to know is. is this result correct but not reduce
> > to same domain? And does it have nasty consequences later - ie do
> > other thing rely on the result to be in this domain?
> 
> No, there is definitely no nasty consequence.
> 

Good.

> > One more question, if we need to link against mpir's libgmp, does linking
> > sage itself against it enough, or do we need to also link pari, mpfr,
> > mpfi and other against it as well? mpfr in itself would be a problem as
> > it is part of the toolchain (gcc is compiled against it).
> 
> I think linking sage itself is likely to be enough for doctests to
> pass, though it is hard to be sure.  It would be nice to link pari
> too.
> 

I may have a strategy to use mpir instead of gmp in pari and some others if 
needed although mpfr would need extra care if required.

Francois

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to