improvement

This commit is contained in:
2026-07-02 04:12:30 +03:00
parent 9eb4dd1155
commit 935f69426c
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -125,7 +125,7 @@ namespace omath
}
[[nodiscard]]
constexpr Angle operator+(const Angle& other) noexcept
constexpr Angle operator+(const Angle& other) const noexcept
{
if constexpr (flags == AngleFlags::Normalized)
return Angle{angles::wrap_angle(m_angle + other.m_angle, min, max)};
@@ -140,7 +140,7 @@ namespace omath
}
[[nodiscard]]
constexpr Angle operator-(const Angle& other) noexcept
constexpr Angle operator-(const Angle& other) const noexcept
{
return operator+(-other);
}
+2 -2
View File
@@ -183,7 +183,7 @@ TEST(UnitTestAngle, Formatter_PrintsDegreesWithSuffix)
TEST(UnitTestAngle, BinaryPlus_ReturnsWrappedSum)
{
Angle<> a = Deg::from_degrees(350.0f);
const Angle<> a = Deg::from_degrees(350.0f);
const Deg b = Deg::from_degrees(20.0f);
const Deg c = a + b; // expect 10°
EXPECT_FLOAT_EQ(c.as_degrees(), 10.0f);
@@ -191,7 +191,7 @@ TEST(UnitTestAngle, BinaryPlus_ReturnsWrappedSum)
TEST(UnitTestAngle, BinaryMinus_ReturnsWrappedDiff)
{
Angle<> a = Deg::from_degrees(10.0f);
const Angle<> a = Deg::from_degrees(10.0f);
const Deg b = Deg::from_degrees(30.0f);
const Deg c = a - b; // expect 340°
EXPECT_FLOAT_EQ(c.as_degrees(), 340.0f);