summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-15 07:53:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-15 07:53:49 -0800
commit9ddfef0aa6718731db7823c20c5ff21be4311197 (patch)
treedaab6391b211d18ec52cad30cd70c3605f38ec20 /arith.c
parent4a2d84b3dcfed6226b95c4cc32dd3d58bc848868 (diff)
downloadtxr-9ddfef0aa6718731db7823c20c5ff21be4311197.tar.gz
txr-9ddfef0aa6718731db7823c20c5ff21be4311197.tar.bz2
txr-9ddfef0aa6718731db7823c20c5ff21be4311197.zip
* arith.c (atang2): New function.
* eval.c (eval_init): Register as atang2 as a atan2 intrinsic. * lib.h (atang2): Declared. * txr.1: Documented atan2.
Diffstat (limited to 'arith.c')
-rw-r--r--arith.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arith.c b/arith.c
index e4972209..09828f59 100644
--- a/arith.c
+++ b/arith.c
@@ -1431,6 +1431,12 @@ val atang(val num)
return flo(atan(c_flo(to_float(lit("atan"), num))));
}
+val atang2(val y, val x)
+{
+ return flo(atan2(c_flo(to_float(lit("atan2"), y)),
+ c_flo(to_float(lit("atan2"), x))));
+}
+
val loga(val num)
{
return flo(log(c_flo(to_float(lit("log"), num))));