diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-03-22 18:27:07 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-03-22 18:27:07 -0700 |
commit | 3979dd9d09801792e8cc4428c4cf80ec98c676a3 (patch) | |
tree | 9392492eca5f107e85919914e05ff59b064d5f5f | |
parent | 3e43fc5cd22e5293aef97cc67721d12fff9b9a84 (diff) | |
download | txr-3979dd9d09801792e8cc4428c4cf80ec98c676a3.tar.gz txr-3979dd9d09801792e8cc4428c4cf80ec98c676a3.tar.bz2 txr-3979dd9d09801792e8cc4428c4cf80ec98c676a3.zip |
* arith.c (expo): New function.
* eval.c (eval_init): expo registered as intrinsic exp.
* lib.h (expo): Declared.
* txr.1: Added to stub heading.
* txr.vim: Highlighting for exp.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | arith.c | 5 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | lib.h | 1 | ||||
-rw-r--r-- | txr.1 | 2 | ||||
-rw-r--r-- | txr.vim | 2 |
6 files changed, 21 insertions, 2 deletions
@@ -1,5 +1,17 @@ 2012-03-22 Kaz Kylheku <kaz@kylheku.com> + * arith.c (expo): New function. + + * eval.c (eval_init): expo registered as intrinsic exp. + + * lib.h (expo): Declared. + + * txr.1: Added to stub heading. + + * txr.vim: Highlighting for exp. + +2012-03-22 Kaz Kylheku <kaz@kylheku.com> + * eval.c (transform_op): use integerp instead of numberp. Not all numbers are integers now, and that situation requires an integer. @@ -1319,6 +1319,11 @@ val loga(val num) return flo(log(c_flo(to_float(lit("log"), num)))); } +val expo(val num) +{ + return flo(exp(c_flo(to_float(lit("exp"), num)))); +} + val sqroot(val num) { return flo(sqrt(c_flo(to_float(lit("sqrt"), num)))); @@ -2193,6 +2193,7 @@ void eval_init(void) reg_fun(intern(lit("cos"), user_package), func_n1(cosi)); reg_fun(intern(lit("atan"), user_package), func_n1(atang)); reg_fun(intern(lit("log"), user_package), func_n1(loga)); + reg_fun(intern(lit("exp"), user_package), func_n1(expo)); reg_fun(intern(lit("sqrt"), user_package), func_n1(sqroot)); reg_fun(intern(lit("fixnump"), user_package), func_n1(fixnump)); reg_fun(intern(lit("bignump"), user_package), func_n1(bignump)); @@ -433,6 +433,7 @@ val sine(val); val cosi(val); val atang(val); val loga(val); +val expo(val); val string_own(wchar_t *str); val string(const wchar_t *str); val string_utf8(const char *str); @@ -6649,7 +6649,7 @@ Certain object types have a custom equal function. .SS Arithmetic function abs -.SS Arithmetic functions floor, ceil, sin, cos, atan, log +.SS Arithmetic functions floor, ceil, sin, cos, atan, log, exp .SS Arithmetic functions expt, sqrt, isqrt @@ -44,7 +44,7 @@ syn keyword txl_keyword contained memq memql memqual tree-find some syn keyword txl_keyword contained remq remql remqual syn keyword txl_keyword contained all none eq eql equal + - * / abs trunc mod syn keyword txl_keyword contained expt exptmod sqrt isqrt gcd -syn keyword txl_keyword contained floor ceil sin cos atan log +syn keyword txl_keyword contained floor ceil sin cos atan log exp syn keyword txl_keyword contained fixnump bignump integerp floatp syn keyword txl_keyword contained numberp zerop evenp oddp > syn keyword txl_keyword contained zerop evenp oddp > < >= <= max min |