summaryrefslogtreecommitdiff
path: root/third-party/boost-math/include/boost/math/complex/fabs.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'third-party/boost-math/include/boost/math/complex/fabs.hpp')
-rw-r--r--third-party/boost-math/include/boost/math/complex/fabs.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/third-party/boost-math/include/boost/math/complex/fabs.hpp b/third-party/boost-math/include/boost/math/complex/fabs.hpp
new file mode 100644
index 000000000000..5eb8b3bd80b5
--- /dev/null
+++ b/third-party/boost-math/include/boost/math/complex/fabs.hpp
@@ -0,0 +1,23 @@
+// (C) Copyright John Maddock 2005.
+// 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)
+
+#ifndef BOOST_MATH_COMPLEX_FABS_INCLUDED
+#define BOOST_MATH_COMPLEX_FABS_INCLUDED
+
+#ifndef BOOST_MATH_HYPOT_INCLUDED
+# include <boost/math/special_functions/hypot.hpp>
+#endif
+
+namespace boost{ namespace math{
+
+template<class T>
+inline T fabs(const std::complex<T>& z)
+{
+ return ::boost::math::hypot(z.real(), z.imag());
+}
+
+} } // namespaces
+
+#endif // BOOST_MATH_COMPLEX_FABS_INCLUDED