diff --git a/userspace/libraries/LibC/math.cpp b/userspace/libraries/LibC/math.cpp index ffec681287..67b7537ca1 100644 --- a/userspace/libraries/LibC/math.cpp +++ b/userspace/libraries/LibC/math.cpp @@ -48,23 +48,10 @@ double func(double a, type b) { return __VA_ARGS__; } \ long double func##l(long double a, type b) { return __VA_ARGS__; } -template -struct integral_atleast; - -template requires(sizeof(T) <= sizeof(uint8_t)) -struct integral_atleast { using type = uint8_t; }; - -template requires(sizeof(T) > sizeof(uint8_t) && sizeof(T) <= sizeof(uint16_t)) -struct integral_atleast { using type = uint16_t; }; - -template requires(sizeof(T) > sizeof(uint16_t) && sizeof(T) <= sizeof(uint32_t)) -struct integral_atleast { using type = uint32_t; }; - -template requires(sizeof(T) > sizeof(uint32_t) && sizeof(T) <= sizeof(uint64_t)) -struct integral_atleast { using type = uint64_t; }; - -template requires(sizeof(T) > sizeof(uint64_t) && sizeof(T) <= sizeof(__uint128_t)) -struct integral_atleast { using type = __uint128_t; }; +template struct float_underlying; +template<> struct float_underlying { using type = uint32_t; }; +template<> struct float_underlying { using type = uint64_t; }; +template<> struct float_underlying { using type = uint64_t; }; template struct __FloatDecompose; @@ -89,7 +76,7 @@ struct __FloatDecompose template struct FloatDecompose { - using value_type = integral_atleast::type; + using value_type = float_underlying::type; static constexpr size_t mantissa_bits = BAN::is_same_v ? FLT_MANT_DIG - 1