Bill Allombert on Tue, 05 Feb 2008 10:41:09 +0100

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

Re: integer n-roots like sqrtint()

On Tue, Feb 05, 2008 at 08:31:27AM +0100, Jeroen Demeyer wrote:
> Karim Belabas wrote:
> >Yes, since perfect powers are the bad case, you could use
> >
> >  if (!ispower(x, n, &z), z = floor(sqrtn(x, n)));
> >  z;
> Yes, I guess that works (at least if the realprecision is sufficiently 
> high).
> I'm wondering if this can be considered a bug in PARI.  Do you think it 

Well, sqrtn could be slightly more accurate since 6. is exactly

> makes sense to change the implementation of sqrtn() to first call 
> ispower() when the argument is an exact integer?

If we improve sqrtn accuracy we should do it for all input, not just
perfect powers.