tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
fmin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_CMATH_FMIN_HPP
5#define TETL_CMATH_FMIN_HPP
6
7#include <etl/_3rd_party/gcem/gcem.hpp>
8
9namespace etl {
10
11/// \ingroup cmath
12/// @{
13
14/// Returns the smaller of two floating point arguments, treating NaNs as
15/// missing data (between a NaN and a numeric value, the numeric value is
16/// chosen)
17///
18/// https://en.cppreference.com/w/cpp/numeric/math/fmin
19[[nodiscard]] constexpr auto fmin(float x, float y) noexcept -> float
20{
21 return etl::detail::gcem::min(x, y);
22}
23
24[[nodiscard]] constexpr auto fminf(float x, float y) noexcept -> float
25{
26 return etl::detail::gcem::min(x, y);
27}
28
29[[nodiscard]] constexpr auto fmin(double x, double y) noexcept -> double
30{
31 return etl::detail::gcem::min(x, y);
32}
33
34[[nodiscard]] constexpr auto fmin(long double x, long double y) noexcept -> long double
35{
36 return etl::detail::gcem::min(x, y);
37}
38
39[[nodiscard]] constexpr auto fminl(long double x, long double y) noexcept -> long double
40{
41 return etl::detail::gcem::min(x, y);
42}
43
44/// @}
45
46} // namespace etl
47
48#endif // TETL_CMATH_FMIN_HPP
constexpr auto fminl(long double x, long double y) noexcept -> long double
Definition fmin.hpp:39
constexpr auto fmin(float x, float y) noexcept -> float
Definition fmin.hpp:19
constexpr auto fmin(double x, double y) noexcept -> double
Definition fmin.hpp:29
constexpr auto fmin(long double x, long double y) noexcept -> long double
Definition fmin.hpp:34
constexpr auto fminf(float x, float y) noexcept -> float
Definition fmin.hpp:24
Definition adjacent_find.hpp:9