From a141c401f78467bc15f62882fca5d55a007cacbb Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 17 Feb 2025 00:21:48 +0100 Subject: Reorganize everything --- asl/base/float.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 asl/base/float.hpp (limited to 'asl/base/float.hpp') diff --git a/asl/base/float.hpp b/asl/base/float.hpp new file mode 100644 index 0000000..2de2e0c --- /dev/null +++ b/asl/base/float.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "asl/base/meta.hpp" + +namespace asl +{ + +template constexpr T infinity() { return __builtin_inf(); } + +template constexpr T nan() { return static_cast(__builtin_nanf("")); } + +template constexpr bool is_infinity(T f) { return __builtin_isinf(f); } + +template constexpr bool is_nan(T f) { return __builtin_isnan(f); } + +} // namespace asl + -- cgit