Skip to content

Commit ce274f7

Browse files
committed
include and order types largerst to smallest
1 parent 7226c00 commit ce274f7

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

include/fast_float/float_common.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <cstdint>
66
#include <cassert>
77
#include <cstring>
8+
#include <limits>
89
#include <type_traits>
910
#include <system_error>
1011
#ifdef __has_include
@@ -222,13 +223,13 @@ fastfloat_really_inline constexpr bool cpp20_and_in_constexpr() {
222223
template <typename T>
223224
struct is_supported_float_type
224225
: std::integral_constant<
225-
bool, std::is_same<T, float>::value || std::is_same<T, double>::value
226-
#ifdef __STDCPP_FLOAT32_T__
227-
|| std::is_same<T, std::float32_t>::value
228-
#endif
226+
bool, std::is_same<T, double>::value || std::is_same<T, float>::value
229227
#ifdef __STDCPP_FLOAT64_T__
230228
|| std::is_same<T, std::float64_t>::value
231229
#endif
230+
#ifdef __STDCPP_FLOAT32_T__
231+
|| std::is_same<T, std::float32_t>::value
232+
#endif
232233
#ifdef __STDCPP_FLOAT16_T__
233234
|| std::is_same<T, std::float16_t>::value
234235
#endif
@@ -757,8 +758,7 @@ template <>
757758
inline constexpr size_t binary_format<std::float16_t>::max_digits() {
758759
return 22;
759760
}
760-
761-
#endif
761+
#endif // __STDCPP_FLOAT16_T__
762762

763763
// credit: Jakub Jelínek
764764
#ifdef __STDCPP_BFLOAT16_T__
@@ -881,8 +881,7 @@ template <>
881881
inline constexpr size_t binary_format<std::bfloat16_t>::max_digits() {
882882
return 98;
883883
}
884-
885-
#endif
884+
#endif // __STDCPP_BFLOAT16_T__
886885

887886
template <>
888887
inline constexpr uint64_t
@@ -1051,7 +1050,6 @@ template <> constexpr char32_t const *str_const_nan<char32_t>() {
10511050
template <> constexpr char8_t const *str_const_nan<char8_t>() {
10521051
return u8"nan";
10531052
}
1054-
10551053
#endif
10561054

10571055
template <typename UC> constexpr UC const *str_const_inf();
@@ -1074,7 +1072,6 @@ template <> constexpr char32_t const *str_const_inf<char32_t>() {
10741072
template <> constexpr char8_t const *str_const_inf<char8_t>() {
10751073
return u8"infinity";
10761074
}
1077-
10781075
#endif
10791076

10801077
template <typename = void> struct int_luts {
@@ -1158,15 +1155,15 @@ static_assert(std::is_same<equiv_uint_t<std::float64_t>, uint64_t>::value,
11581155
static_assert(
11591156
std::numeric_limits<std::float64_t>::is_iec559,
11601157
"std::float64_t must fulfill the requirements of IEC 559 (IEEE 754)");
1161-
#endif
1158+
#endif // __STDCPP_FLOAT64_T__
11621159

11631160
#ifdef __STDCPP_FLOAT32_T__
11641161
static_assert(std::is_same<equiv_uint_t<std::float32_t>, uint32_t>::value,
11651162
"equiv_uint should be uint32_t for std::float32_t");
11661163
static_assert(
11671164
std::numeric_limits<std::float32_t>::is_iec559,
11681165
"std::float32_t must fulfill the requirements of IEC 559 (IEEE 754)");
1169-
#endif
1166+
#endif // __STDCPP_FLOAT32_T__
11701167

11711168
#ifdef __STDCPP_FLOAT16_T__
11721169
static_assert(
@@ -1175,7 +1172,7 @@ static_assert(
11751172
static_assert(
11761173
std::numeric_limits<std::float16_t>::is_iec559,
11771174
"std::float16_t must fulfill the requirements of IEC 559 (IEEE 754)");
1178-
#endif
1175+
#endif // __STDCPP_FLOAT16_T__
11791176

11801177
#ifdef __STDCPP_BFLOAT16_T__
11811178
static_assert(
@@ -1184,7 +1181,7 @@ static_assert(
11841181
static_assert(
11851182
std::numeric_limits<std::bfloat16_t>::is_iec559,
11861183
"std::bfloat16_t must fulfill the requirements of IEC 559 (IEEE 754)");
1187-
#endif
1184+
#endif // __STDCPP_BFLOAT16_T__
11881185

11891186
constexpr chars_format operator~(chars_format rhs) noexcept {
11901187
using int_type = std::underlying_type<chars_format>::type;

0 commit comments

Comments
 (0)