Fix missing IsZero and IsOne for int32

This commit is contained in:
Wojciech Figat
2022-06-28 10:39:12 +02:00
parent 443ce106e2
commit 5ee8785ede

View File

@@ -435,6 +435,14 @@ namespace Math
return amount <= 0 ? 0 : amount >= 1 ? 1 : amount * amount * amount * (amount * (amount * 6 - 15) + 10);
}
// Determines whether the specified value is close to zero (0.0)
// @param a The integer value
// @returns True if the specified value is close to zero (0.0). otherwise false
inline int32 IsZero(int32 a)
{
return a == 0;
}
// Determines whether the specified value is close to zero (0.0f)
// @param a The floating value
// @returns True if the specified value is close to zero (0.0f). otherwise false
@@ -443,6 +451,14 @@ namespace Math
return Abs(a) < ZeroTolerance;
}
// Determines whether the specified value is close to one (1.0)
// @param a The integer value
// @returns True if the specified value is close to one (1.0). otherwise false
inline bool IsOne(int32 a)
{
return a == 1;
}
// Determines whether the specified value is close to one (1.0f)
// @param a The floating value
// @returns True if the specified value is close to one (1.0f). otherwise false