Jeroen Demeyer on Tue, 05 Feb 2008 08:47:03 +0100

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

Re: integer n-roots like sqrtint()

Karim Belabas wrote:
Yes, since perfect powers are the bad case, you could use

  if (!ispower(x, n, &z), z = floor(sqrtn(x, n)));

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 makes sense to change the implementation of sqrtn() to first call ispower() when the argument is an exact integer?