From fbfe506e2e7e2c86763997057d7e10c691c61b32 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Fri, 20 Mar 2020 14:06:18 +0100 Subject: add support for modulo operator --- src/template.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/template.c b/src/template.c index e8fcf36..0d1faa8 100644 --- a/src/template.c +++ b/src/template.c @@ -398,6 +398,7 @@ struct unja_object *eval_infix_expression(struct unja_object *left, char *op, st case '-': result = object_to_int(left) - object_to_int(right); break; case '/': result = object_to_int(left) / object_to_int(right); break; case '*': result = object_to_int(left) * object_to_int(right); break; + case '%': result = object_to_int(left) % object_to_int(right); break; case '>': if (op[1] == '=') { result = object_to_int(left) >= object_to_int(right); -- cgit v1.2.3