- Fixed some minor issues due to MSVC compat

This commit is contained in:
2025-07-02 17:26:22 -04:00
parent 9ea63478e5
commit e2ea22f12d
5 changed files with 33 additions and 31 deletions

View File

@@ -451,13 +451,13 @@ constexpr vector<genType, i...> trunc(const vector<genType, i...>& x)
template<typename genType>
constexpr genType roundEven(genType x)
{
const float e = numeric_limits<genType>::epsilon();
float f = x - fennec::floor(x);
const genType e = numeric_limits<genType>::epsilon();
genType f = x - fennec::floor(x);
if (fennec::abs(f - genType(0.5)) > e)
return fennec::round(x);
float i = fennec::floor(x);
float r = i / 2;
genType i = fennec::floor(x);
genType r = i / 2;
bool up = r - fennec::floor(r) > e;
return i + static_cast<genType>(up);
}