Files

36 lines
879 B
C++

// (C) Copyright Matt Borland 2021.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Constepxr implementation of fabs (see c.math.abs secion 26.8.2 of the ISO standard)
#ifndef ACTIV_BOOST_MATH_CCMATH_FABS
#define ACTIV_BOOST_MATH_CCMATH_FABS
#include <ActivBoost/math/ccmath/abs.hpp>
namespace Boost::math::ccmath {
template <typename T>
inline constexpr auto fabs(T x) noexcept
{
return Boost::math::ccmath::abs(x);
}
inline constexpr float fabsf(float x) noexcept
{
return Boost::math::ccmath::abs(x);
}
#ifndef ACTIV_BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
inline constexpr long double fabsl(long double x) noexcept
{
return Boost::math::ccmath::abs(x);
}
#endif
}
#endif // ACTIV_BOOST_MATH_CCMATH_FABS