summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-05-09 13:26:04 +0200
committerAmlal <amlal@nekernel.org>2025-05-09 13:26:04 +0200
commitd0ce78e95b8d37a084aa95290eb8e92a423b31ae (patch)
treee516e6f794c060c813c834c37f02aa648d669029 /lib
parent03c81e0d2d37b0ad4b67dbe468851cf2b3f13e2e (diff)
feat(lib): add math.hpp for STL-inspired utilities.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/astdx/math.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/astdx/math.hpp b/lib/astdx/math.hpp
new file mode 100644
index 0000000..6d344bd
--- /dev/null
+++ b/lib/astdx/math.hpp
@@ -0,0 +1,35 @@
+/*
+ * File: equiv.hpp
+ * Purpose: mathematics c++ header.
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
+ * Copyright 2025, Amlal El Mahrouss all rights reserved.
+ */
+
+#pragma once
+
+#include <cmath>
+
+namespace astdx::math
+{
+ template <size_t T>
+ struct is_non_boolean_integer final
+ {
+ static constexpr const bool value = true;
+ };
+
+ template <>
+ struct is_non_boolean_integer<false> final
+ {
+ static constexpr const bool value = false;
+ };
+
+ template <>
+ struct is_non_boolean_integer<true> final
+ {
+ static constexpr const bool value = false;
+ };
+
+ constexpr inline auto not_a_number = NAN;
+ constexpr inline auto positive_infinity = INFINITY;
+ constexpr inline auto negative_infinity = -positive_infinity;
+} // namespace astdx::math \ No newline at end of file