Skip to content

Commit cf592ff

Browse files
committed
Use fmin to compute min of floating-point values
1 parent 2322259 commit cf592ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/codegen/codegen_c.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,9 @@ void CodeGen_C::visit(const Min* op) {
483483
op->operands[0].accept(this);
484484
return;
485485
}
486+
const auto opString = op->type.isFloat() ? "fmin" : "TACO_MIN";
486487
for (size_t i=0; i<op->operands.size()-1; i++) {
487-
stream << "TACO_MIN(";
488+
stream << opString << "(";
488489
op->operands[i].accept(this);
489490
stream << ",";
490491
}

0 commit comments

Comments
 (0)