Skip to content

Commit 1b33f60

Browse files
committed
Fix Complex Constant in C.
1 parent 8f83e92 commit 1b33f60

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/libasr/codegen/asr_to_c.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,9 @@ R"(
590590

591591
void visit_ComplexConstant(const ASR::ComplexConstant_t &x) {
592592
headers.insert("complex");
593-
594-
ASR::Complex_t *t = ASR::down_cast<ASR::Complex_t>(x.m_type);
595-
596593
std::string re = std::to_string(x.m_re);
597594
std::string im = std::to_string(x.m_im);
598-
599-
std::string type_name = "float complex";
600-
if (t->m_kind == 8) type_name = "double complex";
601-
602-
src = "(" + type_name + ") (" + re + ", " + im + ")";
595+
src = "CMPLX(" + re + ", " + im + ")";
603596

604597
last_expr_precedence = 2;
605598
}

0 commit comments

Comments
 (0)