tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isfinite.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_CMATH_ISFINITE_HPP
5#define TETL_CMATH_ISFINITE_HPP
6
7#include <etl/_cmath/isinf.hpp>
8#include <etl/_cmath/isnan.hpp>
9
10namespace etl {
11
12/// Determines if the given floating point number arg has finite value
13/// i.e. it is normal, subnormal or zero, but not infinite or NaN.
14/// \details https://en.cppreference.com/w/cpp/numeric/math/isfinite
15/// \ingroup cmath
16[[nodiscard]] constexpr auto isfinite(float arg) -> bool
17{
18 return not etl::isnan(arg) and not etl::isinf(arg);
19}
20
21/// \ingroup cmath
22[[nodiscard]] constexpr auto isfinite(double arg) -> bool
23{
24 return not etl::isnan(arg) and not etl::isinf(arg);
25}
26
27/// \ingroup cmath
28[[nodiscard]] constexpr auto isfinite(long double arg) -> bool
29{
30 return not etl::isnan(arg) and not etl::isinf(arg);
31}
32
33} // namespace etl
34
35#endif // TETL_CMATH_ISFINITE_HPP
constexpr auto isnan(double arg) -> bool
Definition isnan.hpp:27
constexpr auto isfinite(long double arg) -> bool
Definition isfinite.hpp:28
constexpr auto isinf(double arg) -> bool
Definition isinf.hpp:40
constexpr auto isnan(float arg) -> bool
Determines if the given floating point number arg is a not-a-number (NaN) value.
Definition isnan.hpp:17
constexpr auto isfinite(double arg) -> bool
Definition isfinite.hpp:22
constexpr auto isnan(long double arg) -> bool
Definition isnan.hpp:37
constexpr auto isinf(float arg) -> bool
Determines if the given floating point number arg is a positive or negative infinity.
Definition isinf.hpp:34
constexpr auto isinf(long double arg) -> bool
Definition isinf.hpp:46
constexpr auto isfinite(float arg) -> bool
Determines if the given floating point number arg has finite value i.e. it is normal,...
Definition isfinite.hpp:16
Definition adjacent_find.hpp:9