aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-03 01:15:24 +0200
committerEugen Wissner <belka@caraus.de>2026-10-03 01:15:24 +0200
commit2ea84997ae37517729c3c8ed3af8a000bdc632df (patch)
tree97f93b33d1e71beb02e93e6edcd0ae5b05a13817 /include
parent128a564be05afb1cb2ec76884a81c2bd536899fd (diff)
downloadelna-2ea84997ae37517729c3c8ed3af8a000bdc632df.tar.gz
Calculate #min and max based on target architecture
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/result.h22
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;