CNL  2.0.2 (development)
Compositional Numeric Library
cmath.h
Go to the documentation of this file.
1 
2 // Copyright John McFarlane 2018.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file ../LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
10 
11 #if !defined(CNL_CMATH_H)
12 #define CNL_CMATH_H
13 
14 #include "_impl/cmath/abs.h"
15 #include "_impl/cmath/sqrt.h"
16 
17 #include <cmath>
18 #include <concepts>
19 
21 namespace cnl {
22  using _impl::abs;
23 
24  [[nodiscard]] constexpr auto sqrt(std::floating_point auto const& x)
25  {
26  return std::sqrt(x);
27  }
28 }
29 
30 #endif // CNL_CMATH_H
std::sqrt
T sqrt(T... args)
cnl::sqrt
constexpr auto sqrt(Integer const &x)
integer overload of cnl::sqrt
Definition: sqrt.h:25
cnl
compositional numeric library
Definition: abort.h:15
cnl::abs
constexpr auto abs(scaled_integer< Rep, Scale > const &x) noexcept -> decltype(-x)
absolute value
Definition: extras.h:43