summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/logic/math.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-26 01:47:32 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-26 01:47:32 +0100
commitc52dbf5513ae7f106634967162da5cfb01dc5af3 (patch)
treeb6715d0fdacebd48491b9b05cf85f1d92028f84b /dev/lib/logic/math.hpp
parent01565adb9cf5ef991196f56c7f5f7b6161daa005 (diff)
feat: SOCL v1.0.2, changelog soon!v1.0.2
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/logic/math.hpp')
-rw-r--r--dev/lib/logic/math.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/dev/lib/logic/math.hpp b/dev/lib/logic/math.hpp
new file mode 100644
index 0000000..2613799
--- /dev/null
+++ b/dev/lib/logic/math.hpp
@@ -0,0 +1,35 @@
+/*
+ * File: math.hpp
+ * Purpose: Mathematics c++ header.
+ * Author: Amlal El Mahrouss (founder@snu.systems)
+ * Copyright 2025, Amlal El Mahrouss all rights reserved.
+ */
+
+#pragma once
+
+#include <cmath>
+
+namespace snu::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 snu::math \ No newline at end of file