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 /lib.h | |
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 'lib.h')
-rw-r--r-- | lib.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |