From 6b131c925dee7a5f97516edd581e051e08bb52d8 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 20 Jul 2026 16:09:24 +0200 Subject: Implement min and max for booleans and floats --- boot/evaluator.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'boot/evaluator.cc') diff --git a/boot/evaluator.cc b/boot/evaluator.cc index b7edd3a..7eb612b 100644 --- a/boot/evaluator.cc +++ b/boot/evaluator.cc @@ -534,6 +534,14 @@ namespace elna::boot { return constant_value{ static_cast(0) }; } + if (is_primitive_type(resolved, "Bool")) + { + return constant_value{ false }; + } + if (is_primitive_type(resolved, "Float")) + { + return constant_value{ -std::numeric_limits::max() }; + } if (auto enumeration = resolved.get()) { return constant_value{ 1 }; @@ -555,6 +563,14 @@ namespace elna::boot { return constant_value{ std::numeric_limits::max() }; } + if (is_primitive_type(resolved, "Bool")) + { + return constant_value{ true }; + } + if (is_primitive_type(resolved, "Float")) + { + return constant_value{ std::numeric_limits::max() }; + } if (auto enumeration = resolved.get()) { return constant_value{ static_cast(enumeration->members.size()) }; -- cgit v1.2.3