summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-05 14:47:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-05 14:47:22 -0800
commit0cd4fc4869d368c81436a43e3df59d0d42022783 (patch)
treedcc34b739587cdd3eb573180d0f264018cffb40d /lib.h
parent5e4c74dfd5927b3829b4f5e04a7964dbac6a4f34 (diff)
downloadtxr-0cd4fc4869d368c81436a43e3df59d0d42022783.tar.gz
txr-0cd4fc4869d368c81436a43e3df59d0d42022783.tar.bz2
txr-0cd4fc4869d368c81436a43e3df59d0d42022783.zip
New function: square.
The square function calulates (* x x) but is faster for bignum integers by taking advantage of mp_sqr. * arith.c (square): New function. * eval.c (eval_init): Register square as intrinsic. * lib.h (square): Declared. * txr.1: Documented.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 6570d904..d54ea7fa 100644
--- a/lib.h
+++ b/lib.h
@@ -721,6 +721,7 @@ val exptv(struct args *nlist);
val exptmod(val base, val exp, val mod);
val sqroot(val anum);
val isqrt(val anum);
+val square(val anum);
val gcd(val anum, val bnum);
val gcdv(struct args *nlist);
val lcm(val anum, val bnum);