X-Git-Url: https://code.kerkeslager.com/?p=fur;a=blobdiff_plain;f=templates%2Fprogram.c;h=063587d7adcd33a2091cdcca78a98e42d1338913;hp=274aa33aaa795a02e4b8e0188526fa4b6774a26f;hb=f60d1b48bbf73c51d214c5ae5c22ea3cdee087c1;hpb=08c7721c3ab3b3ba8c97b48fad718d2b59d36a0e diff --git a/templates/program.c b/templates/program.c index 274aa33..063587d 100644 --- a/templates/program.c +++ b/templates/program.c @@ -169,6 +169,19 @@ Object builtin$modularDivide(Object left, Object right) return result; } +{% if 'pow' in builtins %} +Object builtin$pow(Object base, Object exponent) +{ + assert(base.type == INTEGER); + assert(exponent.type == INTEGER); + + Object result; + result.type = INTEGER; + result.instance.integer = pow(base.instance.integer, exponent.instance.integer); + return result; +} +{% endif %} + {% if 'print' in builtins %} void builtin$print(Object output) {