diff options
author | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-20 14:06:18 +0100 |
---|---|---|
committer | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-20 14:06:18 +0100 |
commit | fbfe506e2e7e2c86763997057d7e10c691c61b32 (patch) | |
tree | c5ddaa4cbd10edc2e02b008c1583a1d5891f2c98 /src | |
parent | 9f4d4ab24e7a539621bcd810b84201b0127c0870 (diff) | |
download | unja-fbfe506e2e7e2c86763997057d7e10c691c61b32.tar.gz unja-fbfe506e2e7e2c86763997057d7e10c691c61b32.zip |
add support for modulo operator
Diffstat (limited to 'src')
-rw-r--r-- | src/template.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); |