aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-13 16:32:00 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-13 16:32:00 -0400
commite0223a4c201b42ca35c73bfad84477efc61f06b2 (patch)
tree7f83903c19433c67e102a8688c3af02fd63eab0a /compile.c
parentaaac5dff28b2fa4835dd9a3a352f274069a7b432 (diff)
Support ^ exponentiation for integers
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 1053b739..1aaae695 100644
--- a/compile.c
+++ b/compile.c
@@ -1351,7 +1351,7 @@ CORD compile_math_method(env_t *env, binop_e op, ast_t *lhs, ast_t *rhs, type_t
break;
}
case BINOP_POWER: {
- if (rhs_t->tag == NumType) {
+ if (rhs_t->tag == NumType || rhs_t->tag == IntType) {
binding_t *b = get_namespace_binding(env, lhs, binop_method_names[op]);
if (binding_works(b, lhs_t, rhs_t, lhs_t))
return CORD_all(b->code, "(", compile(env, lhs), ", ", compile(env, rhs), ")");