Skip to content

Commit

Permalink
Try fixing Wconversion error on gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
chiphogg committed Dec 15, 2023
1 parent 1d991b7 commit 9a28dd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion au/apply_magnitude.hh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ struct ApplyMagnitudeImpl<Mag, ApplyAs::RATIONAL_MULTIPLY, T, true> {
"Mismatched instantiation (should never be done manually)");

constexpr T operator()(const T &x) {
return x * get_value<T>(numerator(Mag{})) / get_value<T>(denominator(Mag{}));
return static_cast<T>(x * get_value<T>(numerator(Mag{})) /
get_value<T>(denominator(Mag{})));
}

static constexpr bool would_overflow(const T &x) {
Expand Down

0 comments on commit 9a28dd7

Please sign in to comment.