Use pi casted to appropriate type instead of implicit conversion to double in math/math.hpp

This commit is contained in:
Nikita Lisitsa 2025-02-23 11:46:43 +03:00
parent 85451a1d6f
commit 4c16594b3f

View file

@ -35,13 +35,13 @@ namespace psemek::math
template <typename T>
T deg(T x)
{
return static_cast<T>((180 * x) / pi);
return static_cast<T>((180 * x) / static_cast<T>(pi));
}
template <typename T>
T rad(T x)
{
return static_cast<T>((x * pi) / 180);
return static_cast<T>((x * static_cast<T>(pi)) / 180);
}
template <typename X, typename T>