Skip to content

Commit

Permalink
Fix std::pow numeric promotions for roc-stdpar
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 committed Sep 1, 2023
1 parent 5ce76b5 commit 7bc1c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ template <typename N> struct SummaryStats {
sum = std::accumulate(ys.begin(), ys.end(), N(0));
mean = sum / ys.size();
variance =
std::accumulate(ys.begin(), ys.end(), N(0), [&](auto acc, auto t) { return acc + std::pow(t - mean, 2); }) /
std::accumulate(ys.begin(), ys.end(), N(0), [&](auto acc, auto t) { return acc + std::pow(t - mean, 2.0); }) /
ys.size();
stdDev = std::sqrt(variance);
}
Expand Down

0 comments on commit 7bc1c0d

Please sign in to comment.