From 7bc1c0d8a98b6f97f3f4e0ebceb396438db40adc Mon Sep 17 00:00:00 2001 From: Tom Lin Date: Fri, 1 Sep 2023 03:53:49 +0100 Subject: [PATCH] Fix std::pow numeric promotions for roc-stdpar --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ddc6cde..44f65dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,7 +100,7 @@ template 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); }