Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Oct 23, 2023
1 parent 8851ac8 commit 44fe4d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/etl/builder/expression_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ value_t<E> asum(E&& values) {
*/
template <etl_expr E>
value_t<E> mean(E&& values) {
return sum(values) / etl::size(values);
return sum(values) / static_cast<value_t<E>>(etl::size(values));
}

/*!
Expand All @@ -658,7 +658,7 @@ value_t<E> mean(E&& values) {
*/
template <etl_expr E>
value_t<E> amean(E&& values) {
return asum(values) / etl::size(values);
return asum(values) / static_cast<value_t<E>>(etl::size(values));
}

/*!
Expand All @@ -675,7 +675,7 @@ value_t<E> stddev(E&& values) {
std += (value - mean) * (value - mean);
}

return std::sqrt(std / etl::size(values));
return std::sqrt(std / static_cast<double>(etl::size(values)));
}

/*!
Expand All @@ -693,7 +693,7 @@ value_t<E> stddev(E&& values, value_t<E> mean) {
std += (value - mean) * (value - mean);
}

return std::sqrt(std / etl::size(values));
return std::sqrt(std / static_cast<double>(etl::size(values)));
}

namespace detail {
Expand Down

0 comments on commit 44fe4d9

Please sign in to comment.