tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
remainder.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_REMAINDER_HPP
5#define TETL_CMATH_REMAINDER_HPP
6
7#include <etl/_3rd_party/gcem/gcem.hpp>
8
9namespace etl {
10
11/// Computes the remainder of the floating point division operation x/y.
12/// \details https://en.cppreference.com/w/cpp/numeric/math/remainder
13/// \ingroup cmath
14[[nodiscard]] constexpr auto remainder(float x, float y) noexcept -> float
15{
16 return etl::detail::gcem::fmod(x, y);
17}
18
19/// Computes the remainder of the floating point division operation x/y.
20/// \details https://en.cppreference.com/w/cpp/numeric/math/remainder
21/// \ingroup cmath
22[[nodiscard]] constexpr auto remainderf(float x, float y) noexcept -> float
23{
24 return etl::detail::gcem::fmod(x, y);
25}
26
27/// Computes the remainder of the floating point division operation x/y.
28/// \details https://en.cppreference.com/w/cpp/numeric/math/remainder
29/// \ingroup cmath
30[[nodiscard]] constexpr auto remainder(double x, double y) noexcept -> double
31{
32 return etl::detail::gcem::fmod(x, y);
33}
34
35/// Computes the remainder of the floating point division operation x/y.
36/// \details https://en.cppreference.com/w/cpp/numeric/math/remainder
37/// \ingroup cmath
38[[nodiscard]] constexpr auto remainder(long double x, long double y) noexcept -> long double
39{
40 return etl::detail::gcem::fmod(x, y);
41}
42
43/// Computes the remainder of the floating point division operation x/y.
44/// \details https://en.cppreference.com/w/cpp/numeric/math/remainder
45/// \ingroup cmath
46[[nodiscard]] constexpr auto remainderl(long double x, long double y) noexcept -> long double
47{
48 return etl::detail::gcem::fmod(x, y);
49}
50
51} // namespace etl
52
53#endif // TETL_CMATH_REMAINDER_HPP
constexpr auto remainderf(float x, float y) noexcept -> float
Computes the remainder of the floating point division operation x/y.
Definition remainder.hpp:22
constexpr auto remainderl(long double x, long double y) noexcept -> long double
Computes the remainder of the floating point division operation x/y.
Definition remainder.hpp:46
constexpr auto remainder(double x, double y) noexcept -> double
Computes the remainder of the floating point division operation x/y.
Definition remainder.hpp:30
constexpr auto remainder(long double x, long double y) noexcept -> long double
Computes the remainder of the floating point division operation x/y.
Definition remainder.hpp:38
constexpr auto remainder(float x, float y) noexcept -> float
Computes the remainder of the floating point division operation x/y.
Definition remainder.hpp:14
Definition adjacent_find.hpp:9