From 2ea84997ae37517729c3c8ed3af8a000bdc632df Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 3 Oct 2026 01:15:24 +0200 Subject: Calculate #min and max based on target architecture --- include/elna/boot/result.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'include') 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 + requires is_floating_point_v + 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 word_properties; type_properties pointer_properties; type_properties char_properties; - type_properties single_properties; - type_properties double_properties; + float_properties single_properties; + float_properties double_properties; type_properties bool_properties; /// C's \c int, the type narrower variadic arguments are promoted to. type_properties c_int_properties; -- cgit v1.2.3