bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: seg fault in mpz_root patch


From: Kevin Ryde
Subject: Re: seg fault in mpz_root patch
Date: Tue, 17 Dec 2002 10:15:38 +1000
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.1 (i386-debian-linux-gnu)

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.

Perhaps the number of bits in {up,usize} can be worked into the
calculation.  The intermediate power would be no more than twice that
amount would it?  Or twice plus a few bits, or something.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]