From cac651cd88f8da1e5957b0cc13fa25d79e1887fc Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 23 Aug 2016 20:58:50 +0200 Subject: Many things - two-letter AST union members - AST_QUOTED - AST_LAMBDA - an interpreter that works - function registering in the interpreter - some builtins --- util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index d6890d6..d598f17 100644 --- a/util.c +++ b/util.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "util.h" @@ -26,6 +27,14 @@ __attribute__((noreturn)) void outofmem(void){ } +double floatmod(double a,double b){ + if(b==0)return nan(""); + int sa=a<0?-1:1; + a=fabs(a); b=fabs(b); + return sa*(a-b*floor(a/b)); +} + + void* malloccheck(size_t n){ void *p=mallocreal(n); if(!p)outofmem(); -- cgit v1.2.3-54-g00ecf