tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
fdim.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_CMATH_FDIM_HPP
4#define TETL_CMATH_FDIM_HPP
5
6#include <etl/_cmath/fmax.hpp>
7
8namespace etl {
9
12
16[[nodiscard]] constexpr auto fdim(float x, float y) noexcept -> float { return etl::fmax(x - y, 0); }
17[[nodiscard]] constexpr auto fdimf(float x, float y) noexcept -> float { return etl::fmax(x - y, 0); }
18[[nodiscard]] constexpr auto fdim(double x, double y) noexcept -> double { return etl::fmax(x - y, 0); }
19[[nodiscard]] constexpr auto fdim(long double x, long double y) noexcept -> long double { return etl::fmax(x - y, 0); }
20[[nodiscard]] constexpr auto fdiml(long double x, long double y) noexcept -> long double { return etl::fmax(x - y, 0); }
21
23
24} // namespace etl
25
26#endif // TETL_CMATH_FDIM_HPP
constexpr auto fdiml(long double x, long double y) noexcept -> long double
Returns the positive difference between x and y, that is, if x>y, returns x-y, otherwise (if x≤y),...
Definition fdim.hpp:20
constexpr auto fdimf(float x, float y) noexcept -> float
Returns the positive difference between x and y, that is, if x>y, returns x-y, otherwise (if x≤y),...
Definition fdim.hpp:17
constexpr auto fmax(float x, float y) noexcept -> float
Returns the larger of two floating point arguments, treating NaNs as missing data (between a NaN and ...
Definition fmax.hpp:17
constexpr auto fdim(float x, float y) noexcept -> float
Returns the positive difference between x and y, that is, if x>y, returns x-y, otherwise (if x≤y),...
Definition fdim.hpp:16
Definition adjacent_find.hpp:8