On Monday 06 September 2010 20:04:24 Bill Hart wrote:
> On 5 September 2010 19:44, Jeroen Demeyer <[email protected]> wrote:
> > On 2010-09-05 19:37, Jason wrote:
> >> Hi
> >> 
> >> There are a few problems with this , GMP would have to have the same
> >> interface or I certain Pari would not use it.
> > 
> > Well, this could be a Sage-only patch.  As far as I know, exact division
> > is the only place in PARI/GP where GMP/MPIR internals are being used, so
> > it would be nice to get rid of this.
> 
> It seems reasonable to me that we could mark the documentation with
> "MPIR only" for functions supported by us and not by GMP.
> 
> The problem is that suppose MPIR defines mpn_divexact one way, then
> GMP come along and define it differently, but with the same name. We
> then have to change MPIR to be compatible with GMP, breaking
> everyone's code who relied upon the MPIR interface.
> 

This can be solved (relatively easily ) by library versioning , basically , if 
I understood it correctly , is that one library can "export" many incompatible 
version of the same function , ie when you link to the library , you have 
specify which version of it you want. I read this a year or two ago , I think 
in the libtool docs.


> This is why Jason is reluctant to document this. If you want to use an
> undocumented function, go right ahead, It's:
> 
> mpn_divexact (mp_ptr qp,
>             mp_srcptr np, mp_size_t nn,
>             mp_srcptr dp, mp_size_t dn)
> 
> which does what you think it does.
> 
> >> There is a second more subtle problem , do
> >> you want divexact (ie division which is only correct when exact ) or
> >> divrem_hensel (ie division which gives the hensel(2-adic) quotient )
> >> If you use mpn_divexact and are relying on it to be hensel division then
> >> when we change the algorithm later for a faster one (ie bidirectional)
> >> then your code will break , or we will have to fudge it.
> > 
> > Well, the point of the public function mpz_divexact() is that you *know*
> > that one number is divisible an other.  Nothing in the mpz_divexact()
> > documentation mentions 2-adic division.  So I think the only necessary
> > criterion is that the quotient is correct when it is known that the
> > remainder is zero.
> 
> The most useful one for me (in flint) is also the divexact interface,
> where you know in advance that it is exactly divisible.
> 
> Bill.
> 
> > Jeroen.
> > 
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mpir-devel" 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/mpir-devel?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" 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/mpir-devel?hl=en.

Reply via email to