tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
fmax.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_FMAX_HPP
5#define TETL_CMATH_FMAX_HPP
6
7#include <etl/_3rd_party/gcem/gcem.hpp>
8
9namespace etl {
10
11/// \ingroup cmath
12/// @{
13
14/// Returns the larger of two floating point arguments, treating NaNs as
15/// missing data (between a NaN and a numeric value, the numeric value is chosen)
16///
17/// https://en.cppreference.com/w/cpp/numeric/math/fmax
18[[nodiscard]] constexpr auto fmax(float x, float y) noexcept -> float
19{
20 return etl::detail::gcem::max(x, y);
21}
22
23[[nodiscard]] constexpr auto fmaxf(float x, float y) noexcept -> float
24{
25 return etl::detail::gcem::max(x, y);
26}
27
28[[nodiscard]] constexpr auto fmax(double x, double y) noexcept -> double
29{
30 return etl::detail::gcem::max(x, y);
31}
32
33[[nodiscard]] constexpr auto fmax(long double x, long double y) noexcept -> long double
34{
35 return etl::detail::gcem::max(x, y);
36}
37
38[[nodiscard]] constexpr auto fmaxl(long double x, long double y) noexcept -> long double
39{
40 return etl::detail::gcem::max(x, y);
41}
42
43/// @}
44
45} // namespace etl
46
47#endif // TETL_CMATH_FMAX_HPP
constexpr auto fmax(double x, double y) noexcept -> double
Definition fmax.hpp:28
constexpr auto fmaxf(float x, float y) noexcept -> float
Definition fmax.hpp:23
constexpr auto fmax(long double x, long double y) noexcept -> long double
Definition fmax.hpp:33
constexpr auto fmax(float x, float y) noexcept -> float
Definition fmax.hpp:18
constexpr auto fmaxl(long double x, long double y) noexcept -> long double
Definition fmax.hpp:38
Definition adjacent_find.hpp:9