diff options
Diffstat (limited to 'libc/test/src/math/HypotTest.h')
-rw-r--r-- | libc/test/src/math/HypotTest.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/test/src/math/HypotTest.h b/libc/test/src/math/HypotTest.h index dc73581..b37abf7 100644 --- a/libc/test/src/math/HypotTest.h +++ b/libc/test/src/math/HypotTest.h @@ -71,8 +71,9 @@ public: void test_subnormal_range(Func func) { constexpr StorageType COUNT = 10'001; - for (unsigned scale = 0; scale < 4; ++scale) { - StorageType max_value = MAX_SUBNORMAL << scale; + constexpr unsigned SCALE = (sizeof(T) < 4) ? 1 : 4; + for (unsigned scale = 0; scale < SCALE; ++scale) { + StorageType max_value = static_cast<StorageType>(MAX_SUBNORMAL << scale); StorageType step = (max_value - MIN_SUBNORMAL) / COUNT + 1; for (int signs = 0; signs < 4; ++signs) { for (StorageType v = MIN_SUBNORMAL, w = max_value; |