Skip to content

Commit

Permalink
Add explicit static_cast to OutputType
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Mar 5, 2025
1 parent 6a4eba6 commit aeebc35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NAS2D/Math/MathUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace NAS2D
template <typename InputType, typename OutputType>
constexpr OutputType scaleLinear(const InputType& value, const InputType& domainPoint1, const InputType& domainPoint2, const OutputType& rangePoint1, const OutputType& rangePoint2)
{
return (value - domainPoint1) * (rangePoint2 - rangePoint1) / (domainPoint2 - domainPoint1) + rangePoint1;
return static_cast<OutputType>((value - domainPoint1) * (rangePoint2 - rangePoint1) / (domainPoint2 - domainPoint1) + rangePoint1);
}

} // namespace NAS2D

0 comments on commit aeebc35

Please sign in to comment.