From e0223a4c201b42ca35c73bfad84477efc61f06b2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 13 Aug 2024 16:32:00 -0400 Subject: Support ^ exponentiation for integers --- compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compile.c') 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), ")"); -- cgit v1.2.3