ref: df22ae34a79a76ed07090be41fce329b8d3cfe6c
dir: /src/math.c/
#include "flisp.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)