ref: a70379d7e4b822f532fb0a8ccdd1624a90b64a68
dir: /src/math.c/
#include "sl.h" #include "cvalues.h" #define BUILTIN_(lname, cname) \ BUILTIN(lname, cname) \ { \ argcount(nargs, 1); \ return mk_double(cname(todouble(args[0]))); \ } BUILTIN_("sqrt", sqrt) BUILTIN_("exp", exp) BUILTIN_("log", log) BUILTIN_("log10", log10) BUILTIN_("sin", sin) BUILTIN_("cos", cos) BUILTIN_("tan", tan) BUILTIN_("asin", asin) BUILTIN_("acos", acos) BUILTIN_("atan", atan) BUILTIN_("floor", floor) BUILTIN_("ceiling", ceil) BUILTIN_("sinh", sinh) BUILTIN_("cosh", cosh) BUILTIN_("tanh", tanh) #undef BUILTIN_ #define BUILTIN_(lname, cname) \ BUILTIN(lname, cname) \ { \ argcount(nargs, 2); \ return mk_double(cname(todouble(args[0]), todouble(args[1]))); \ } BUILTIN_("expt", pow)