bug-gmp
[Top][All Lists]
Advanced

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

Re: seg fault in mpz_root


From: Kevin Ryde
Subject: Re: seg fault in mpz_root
Date: Fri, 13 Dec 2002 10:12:47 +1000
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.1 (i386-debian-linux-gnu)

Jason Moxham <address@hidden> writes:
>
> the fn mpn_rootrem , calculates an approx root which can be one unit too 
> large 
> , and then it powers it to see if it is too large , if the approx root is 3 , 
> whereas the real root is 2 then after powering a lot more space is required

Ah, beaut.

> 1) would to be allocate enough space for the worst case  eg (3/2)^k more 
> limbs 

Yes, better do that.  Can you come up with a good change for the 4.1.1
code?

> ,assuming mpn_rootrem is only called when root>=2

True currently I think.

> 2) identified these worst cases (these cases can be identified fairly 
> quickly(see my code for example)) and call a mpn_pow_1 which checks for 
> overflow

That might be better for the future.  Unless we change to Paul Z.'s
discrete variant, which if I understand it keeps intermediates below
the true root.



reply via email to

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