Skip to content

Commit

Permalink
🎨 explicitly use std:: prefix for math methods
Browse files Browse the repository at this point in the history
  • Loading branch information
burgholzer committed Feb 7, 2024
1 parent ffe1c66 commit ade870e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/parsers/qasm3_parser/passes/ConstEvalPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ConstEvalValue ConstEvalPass::evalFloatExpression(BinaryExpression::Op op,

switch (op) {
case BinaryExpression::Power:
result.value = pow(lhs, rhs);
result.value = std::pow(lhs, rhs);
break;
case BinaryExpression::Add:
result.value = lhs + rhs;
Expand Down Expand Up @@ -411,42 +411,42 @@ std::optional<ConstEvalValue> ConstEvalPass::visitUnaryExpression(
return std::nullopt;
case UnaryExpression::Sin:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = sin(std::get<1>(val->value));
val->value = std::sin(std::get<1>(val->value));
} else {
return std::nullopt;
}
break;
case UnaryExpression::Cos:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = cos(std::get<1>(val->value));
val->value = std::cos(std::get<1>(val->value));
} else {
return std::nullopt;
}
break;
case UnaryExpression::Tan:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = tan(std::get<1>(val->value));
val->value = std::tan(std::get<1>(val->value));
} else {
return std::nullopt;
}
break;
case UnaryExpression::Exp:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = exp(std::get<1>(val->value));
val->value = std::exp(std::get<1>(val->value));
} else {
return std::nullopt;
}
break;
case UnaryExpression::Ln:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = log(std::get<1>(val->value));
val->value = std::log(std::get<1>(val->value));
} else {
return std::nullopt;
}
break;
case UnaryExpression::Sqrt:
if (val->type == ConstEvalValue::Type::ConstFloat) {
val->value = sqrt(std::get<1>(val->value));
val->value = std::sqrt(std::get<1>(val->value));
} else {
return std::nullopt;
}
Expand Down

0 comments on commit ade870e

Please sign in to comment.