// Copyright (C) 2008-2012 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // ------------------------------------------------------------------- // // Written by Conrad Sanderson - http://conradsanderson.id.au //! \addtogroup fn_trunc_exp //! @{ template inline static typename arma_real_only::result trunc_exp(const eT x) { if(std::numeric_limits::is_iec559 && (x >= Math::log_max() )) { return std::numeric_limits::max(); } else { return std::exp(x); } } template inline static typename arma_integral_only::result trunc_exp(const eT x) { return eT( trunc_exp( double(x) ) ); } template inline static std::complex trunc_exp(const std::complex& x) { return std::polar( trunc_exp( x.real() ), x.imag() ); } template arma_inline const eOp trunc_exp(const Base& A) { arma_extra_debug_sigprint(); return eOp(A.get_ref()); } template arma_inline const eOpCube trunc_exp(const BaseCube& A) { arma_extra_debug_sigprint(); return eOpCube(A.get_ref()); } //! @}