diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/elna/boot/result.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/elna/boot/result.h b/include/elna/boot/result.h index c7b79d3..540307c 100644 --- a/include/elna/boot/result.h +++ b/include/elna/boot/result.h @@ -826,6 +826,24 @@ namespace elna::boot std::size_t alignment; }; + /** + * Properties of a floating point type on the target machine, including + * its minimum and maximum finite values. + */ + template<typename T> + requires is_floating_point_v<T> + struct float_properties : type_properties + { + T min{}; + T max{}; + + constexpr float_properties() = default; + constexpr float_properties(const type_properties& base, T min, T max) + : type_properties(base), min(min), max(max) + { + } + }; + constexpr std::size_t target_integer_count = 5; /** @@ -837,8 +855,8 @@ namespace elna::boot std::array<type_properties, target_integer_count> word_properties; type_properties pointer_properties; type_properties char_properties; - type_properties single_properties; - type_properties double_properties; + float_properties<float> single_properties; + float_properties<double> double_properties; type_properties bool_properties; /// C's \c int, the type narrower variadic arguments are promoted to. type_properties c_int_properties; |
