summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/logic/math.hpp
diff options
context:
space:
mode:
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