We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 555b354 commit e339c4aCopy full SHA for e339c4a
src/lpython/semantics/python_comptime_eval.h
@@ -250,7 +250,7 @@ struct PythonIntrinsicProcedures {
250
if (!ASRUtils::check_equal_type(arg1_type, arg2_type)) {
251
throw SemanticError("The arguments to pow() must have the same type.", loc);
252
}
253
- if (ASRUtils::is_integer(*arg1_type) || ASRUtils::is_integer(*arg1_type)) {
+ if (ASRUtils::is_integer(*arg1_type) && ASRUtils::is_integer(*arg2_type)) {
254
int64_t a = ASR::down_cast<ASR::ConstantInteger_t>(arg1)->m_n;
255
int64_t b = ASR::down_cast<ASR::ConstantInteger_t>(arg2)->m_n;
256
if (a == 0 && b < 0) { // Zero Division
0 commit comments