[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seg fault in mpz_root patch
From: |
Jason Moxham |
Subject: |
Re: seg fault in mpz_root patch |
Date: |
Tue, 17 Dec 2002 02:47:44 +0000 |
User-agent: |
KMail/1.4.1 |
On Tuesday 17 Dec 2002 12:15 am, Kevin Ryde wrote:
> Jason Moxham <address@hidden> writes:
> > + As the approximate root can be larger than the actual root by at
> > most + a factor of 2 , we need to allow space for another "nth" bits
> > when + powering it using mpn_pow_1 , this is a large overestimate
> > that only + applies in rare cases i.e. when k is large and the root
> > is small + FIXME : change this awful allocation before gmp 4.2
>
> Actually, we ought to try to do better now. Basing an allocation on
> nth will prevent large roots being taken. Not that very large nth is
> sensible, but it should work.
>
It is sensible , just not common :)
> Perhaps the number of bits in {up,usize} can be worked into the
Assuming TMP_ALLOC_LIMBS can be put in an if statement , like
if ( weird_condition ) pp=TMP_ALLOC_LIMBS(something);
else pp=TMP_ALLOC_LIMBS(somethingelse);
then OK
> calculation. The intermediate power would be no more than twice that
> amount would it? Or twice plus a few bits, or something.
The initial approximation is more trouble , unless you know of a reason why it
can not overflow as well ? , mpn_pow_1 does nothing? , although a few tests
with roots close to a power of two should tell me
- seg fault in mpz_root, Jason Moxham, 2002/12/10
- Re: seg fault in mpz_root, Kevin Ryde, 2002/12/10
- Re: seg fault in mpz_root, Jason Moxham, 2002/12/10
- Re: seg fault in mpz_root patch, Jason Moxham, 2002/12/12
- Re: seg fault in mpz_root patch, Kevin Ryde, 2002/12/16
- Re: seg fault in mpz_root patch, Kevin Ryde, 2002/12/16
- Re: seg fault in mpz_root patch,
Jason Moxham <=
- Re: seg fault in mpz_root patch, Kevin Ryde, 2002/12/17
- Re: seg fault in mpz_root patch, Torbjorn Granlund, 2002/12/18