os/ossrv/ossrv_pub/boost_apis/boost/math/complex/fabs.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
//  (C) Copyright John Maddock 2005.
sl@0
     2
//  Use, modification and distribution are subject to the
sl@0
     3
//  Boost Software License, Version 1.0. (See accompanying file
sl@0
     4
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sl@0
     5
sl@0
     6
#ifndef BOOST_MATH_COMPLEX_FABS_INCLUDED
sl@0
     7
#define BOOST_MATH_COMPLEX_FABS_INCLUDED
sl@0
     8
sl@0
     9
#ifndef BOOST_MATH_HYPOT_INCLUDED
sl@0
    10
#  include <boost/math/special_functions/hypot.hpp>
sl@0
    11
#endif
sl@0
    12
sl@0
    13
namespace boost{ namespace math{
sl@0
    14
sl@0
    15
template<class T> 
sl@0
    16
inline T fabs(const std::complex<T>& z)
sl@0
    17
{
sl@0
    18
   return ::boost::math::hypot(z.real(), z.imag());
sl@0
    19
}
sl@0
    20
sl@0
    21
} } // namespaces
sl@0
    22
sl@0
    23
#endif // BOOST_MATH_COMPLEX_FABS_INCLUDED