~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/mp-nthrt.c: Fix garbled commentary.
[catacomb]
/
math
/
mp-nthrt.c
diff --git
a/math/mp-nthrt.c
b/math/mp-nthrt.c
index
a46590a
..
77e6ebb
100644
(file)
--- a/
math/mp-nthrt.c
+++ b/
math/mp-nthrt.c
@@
-95,7
+95,7
@@
mp *mp_nthrt(mp *d, mp *a, mp *n, int *exactp_out)
assert(MP_POSP(n));
/* Pick a starting point. This is rather important to get right. In
assert(MP_POSP(n));
/* Pick a starting point. This is rather important to get right. In
- * particular, for large %$n$%, if
we our initial gues
s too small, then the
+ * particular, for large %$n$%, if
our initial guess i
s too small, then the
* next iteration is a wild overestimate and it takes a long time to
* converge back.
*/
* next iteration is a wild overestimate and it takes a long time to
* converge back.
*/
@@
-180,10
+180,9
@@
int mp_perfect_power_p(mp **x, mp **n, mp *a)
t = mp_nthrt(t, a, p, &exactp);
if (MP_EQ(t, MP_ONE))
break;
t = mp_nthrt(t, a, p, &exactp);
if (MP_EQ(t, MP_ONE))
break;
- else if (!exactp) {
- if (MP_EQ(t, MP_ONE)) break;
+ else if (!exactp)
p = primeiter_next(&pi, p);
p = primeiter_next(&pi, p);
-
}
else {
+ else {
r = mp_mul(r, r, p);
MP_DROP(a); a = t; t = MP_NEW;
rc = 1;
r = mp_mul(r, r, p);
MP_DROP(a); a = t; t = MP_NEW;
rc = 1;