Mercurial > octave
changeset 23623:4feed155a1f2
Use acosh, acoshf, asinh, asinhf, atanh, atanhf from C++ std library.
These functions are guaranteed to be part of C++11 standard library.
* configure.ac: Remove AC_CHECK_FUNCS for acosh, acoshf, asinh, asinhf, atanh,
atanhf.
* lo-specfun.cc (acosh, asinh, atanh): Map functions onto std::XXX of the same name.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 16 Jun 2017 16:33:30 -0700 |
parents | 0abe8d85ecce |
children | 65e5ddf6d059 |
files | configure.ac liboctave/numeric/lo-specfun.cc |
diffstat | 2 files changed, 12 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac Fri Jun 16 15:51:29 2017 -0700 +++ b/configure.ac Fri Jun 16 16:33:30 2017 -0700 @@ -2455,7 +2455,7 @@ ## Check for nonstandard, but common math functions, that we need. dnl Use multiple AC_CHECKs to avoid line continuations '\' in list -AC_CHECK_FUNCS([acosh acoshf asinh asinhf atanh atanhf cbrt cbrtf]) +AC_CHECK_FUNCS([cbrt cbrtf]) AC_CHECK_FUNCS([erf erff erfc erfcf exp2f hypotf _hypotf log2 log2f]) ## Check for math defines such as M_LN2 in math.h
--- a/liboctave/numeric/lo-specfun.cc Fri Jun 16 15:51:29 2017 -0700 +++ b/liboctave/numeric/lo-specfun.cc Fri Jun 16 16:33:30 2017 -0700 @@ -28,6 +28,8 @@ # include "config.h" #endif +#include <cmath> + #include <algorithm> #include <limits> #include <string> @@ -59,29 +61,9 @@ { namespace math { - double - acosh (double x) - { -#if defined (HAVE_ACOSH) - return ::acosh (x); -#else - double retval; - F77_XFCN (xdacosh, XDACOSH, (x, retval)); - return retval; -#endif - } - - float - acosh (float x) - { -#if defined (HAVE_ACOSHF) - return acoshf (x); -#else - float retval; - F77_XFCN (xacosh, XACOSH, (x, retval)); - return retval; -#endif - } + double acosh (double x) { return std::acosh (x); } + + float acosh (float x) { return std::acoshf (x); } Complex acosh (const Complex& x) @@ -103,29 +85,9 @@ #endif } - double - asinh (double x) - { -#if defined (HAVE_ASINH) - return ::asinh (x); -#else - double retval; - F77_XFCN (xdasinh, XDASINH, (x, retval)); - return retval; -#endif - } - - float - asinh (float x) - { -#if defined (HAVE_ASINHF) - return asinhf (x); -#else - float retval; - F77_XFCN (xasinh, XASINH, (x, retval)); - return retval; -#endif - } + double asinh (double x) { return std::asinh (x); } + + float asinh (float x) { return std::asinhf (x); } Complex asinh (const Complex& x) @@ -147,29 +109,9 @@ #endif } - double - atanh (double x) - { -#if defined (HAVE_ATANH) - return ::atanh (x); -#else - double retval; - F77_XFCN (xdatanh, XDATANH, (x, retval)); - return retval; -#endif - } - - float - atanh (float x) - { -#if defined (HAVE_ATANHF) - return atanhf (x); -#else - float retval; - F77_XFCN (xatanh, XATANH, (x, retval)); - return retval; -#endif - } + double atanh (double x) { return std::atanh (x); } + + float atanh (float x) { return std::atanhf (x); } Complex atanh (const Complex& x)