Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:45:14

0001 //  (C) Copyright Matt Borland 2021.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 //
0006 //  Constepxr implementation of fabs (see c.math.abs secion 26.8.2 of the ISO standard)
0007 
0008 #ifndef BOOST_MATH_CCMATH_FABS
0009 #define BOOST_MATH_CCMATH_FABS
0010 
0011 #include <boost/math/ccmath/detail/config.hpp>
0012 
0013 #ifdef BOOST_MATH_NO_CCMATH
0014 #error "The header <boost/math/fabs.hpp> can only be used in C++17 and later."
0015 #endif
0016 
0017 #include <boost/math/ccmath/abs.hpp>
0018 
0019 namespace boost::math::ccmath {
0020 
0021 template <typename T>
0022 inline constexpr auto fabs(T x) noexcept
0023 {
0024     return boost::math::ccmath::abs(x);
0025 }
0026 
0027 inline constexpr float fabsf(float x) noexcept
0028 {
0029     return boost::math::ccmath::abs(x);
0030 }
0031 
0032 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
0033 inline constexpr long double fabsl(long double x) noexcept
0034 {
0035     return boost::math::ccmath::abs(x);
0036 }
0037 #endif
0038 
0039 }
0040 
0041 #endif // BOOST_MATH_CCMATH_FABS