diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-01-05 14:47:22 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-01-05 14:47:22 -0800 |
commit | 0cd4fc4869d368c81436a43e3df59d0d42022783 (patch) | |
tree | dcc34b739587cdd3eb573180d0f264018cffb40d /txr.1 | |
parent | 5e4c74dfd5927b3829b4f5e04a7964dbac6a4f34 (diff) | |
download | txr-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.1 | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 ) |