feat: improved small num test

This commit is contained in:
2025-11-22 11:58:05 +01:00
parent 939d1e6b1e
commit 7faf830f2e

View File

@@ -81,6 +81,7 @@ struct decimal {
decimal sqrt() { return {((int32_t)sqrtf(i)) << HALF_SHIFT}; }
float to_float() { return TO_FLOAT(i); }
bool isSmall() { return (abs(i) < (1 << (HALF_SHIFT - 1))); }
};
template <int n, class Dev> struct vec {
@@ -164,7 +165,7 @@ template <int n, class Dev> struct vec {
}
bool isSmall() {
for (int i = 0; i < n; i++) {
if (abs(v[i].i) > (1 << (HALF_SHIFT - 1)))
if (!v[i].isSmall())
return false;
}
return true;