summaryrefslogtreecommitdiffstats
path: root/txr.1
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 /txr.1
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 'txr.1')
-rw-r--r--txr.120
1 files changed, 20 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index bf3c9353..f62cc5cf 100644
--- a/txr.1
+++ b/txr.1
@@ -35653,6 +35653,26 @@ and reduced to the
least positive residue modulo
.metn modulus .
+.coNP Function @ square
+.synb
+.mets (square << argument )
+.syne
+.desc
+The
+.code square
+function returns the product of
+.meta argument
+with itself. The following
+equivalence holds, except that
+.code x
+is evaluated only once in the the
+.code square
+expression:
+
+.cblk
+ (square x) <--> (* x x)
+.cble
+
.coNP Function @ cum-norm-dist
.synb
.mets (cum-norm-dist << argument )