summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-07-18 06:59:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-07-18 06:59:26 -0700
commitc9977c0132b2a6a3df994dbdf58c27689658f20f (patch)
tree72601b227e5a9868e990e41936016e59473c6979 /txr.1
parent50c2dbed6f823a286d40a1378626467b09363cbb (diff)
downloadtxr-c9977c0132b2a6a3df994dbdf58c27689658f20f.tar.gz
txr-c9977c0132b2a6a3df994dbdf58c27689658f20f.tar.bz2
txr-c9977c0132b2a6a3df994dbdf58c27689658f20f.zip
* Makefile (conftest, conftest2): Link math
library so we can test for math functions. * arith.c (log2_init): New static function. (log2, logtwo): New functions. (l2): New static variable. (arith_init): Call log2_init. * configure (lang_flags): Switching _XOPEN_SOURCE from 500 to 600 to reveal log2. Adding test for log2. * eval.c (eval_init): Register log2 intrinsic. * lib.h (logtwo): Declared. * txr.1: Documented log2.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.16
1 files changed, 5 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 20b977ab..ea2b06ae 100644
--- a/txr.1
+++ b/txr.1
@@ -10871,7 +10871,7 @@ functions. The <num> argument to asin and acos must be in the
range -1.0 to 1.0. The atan2 function converts the rectilinear coordinates
<x> and <y> to an angle in polar coordinates in the range [0, 2pi).
-.SS Functions exp, log, log10
+.SS Functions exp, log, log10 and log2
.TP
Syntax:
@@ -10879,6 +10879,7 @@ Syntax:
(exp <number>)
(log <number>)
(log10 <number>)
+ (log2 <number>)
.TP
Description:
@@ -10892,6 +10893,9 @@ be a positive value.
The log10 function calculates the base 10 logarithm of its argument, which must
be a positive value.
+The log2 function calculates the base 2 logarithm of its argument, which must
+be a positive value.
+
Integer arguments are converted to floats.
.SS Functions expt, sqrt, isqrt