~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/mp-sqrt.c, math/pgen-granfrob.c: Publish `squarep' function.
[catacomb]
/
math
/
mp.h
diff --git
a/math/mp.h
b/math/mp.h
index
23e71e3
..
75dfd5b
100644
(file)
--- a/
math/mp.h
+++ b/
math/mp.h
@@
-923,6
+923,16
@@
extern mp *mp_leastcongruent(mp */*d*/, mp */*b*/, mp */*r*/, mp */*m*/);
extern mp *mp_sqrt(mp */*d*/, mp */*a*/);
extern mp *mp_sqrt(mp */*d*/, mp */*a*/);
+/* --- @mp_squarep@ --- *
+ *
+ * Arguments: @mp *n@ = an integer
+ *
+ * Returns: Nonzero if and only if @n@ is a perfect square, i.e.,
+ * %$n = a^2$% for some rational integer %$a$%.
+ */
+
+extern int mp_squarep(mp */*n*/);
+
/* --- @mp_nthrt@ --- *
*
* Arguments: @mp *d@ = fake destination
/* --- @mp_nthrt@ --- *
*
* Arguments: @mp *d@ = fake destination