diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 16:32:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 16:32:00 -0400 |
| commit | e0223a4c201b42ca35c73bfad84477efc61f06b2 (patch) | |
| tree | 7f83903c19433c67e102a8688c3af02fd63eab0a /compile.c | |
| parent | aaac5dff28b2fa4835dd9a3a352f274069a7b432 (diff) | |
Support ^ exponentiation for integers
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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), ")"); |
