diff --git a/qad/utils/qpievaluator.h b/qad/utils/qpievaluator.h index 50dec7e..056ba88 100644 --- a/qad/utils/qpievaluator.h +++ b/qad/utils/qpievaluator.h @@ -23,9 +23,15 @@ const double rad2deg_qpie = 45. / atan(1.); inline complexd round_qpie(const complexd & c) {return complexd(round(c.real()), round(c.imag()));} inline complexd floor_qpie(const complexd & c) {return complexd(floor(c.real()), floor(c.imag()));} inline complexd ceil_qpie(const complexd & c) {return complexd(ceil(c.real()), ceil(c.imag()));} -inline complexd atanc_qpie(const complexd & c) {return -complexd(-0.5, 1.) * log((complexd_1 + complexd_i * c) / (complexd_1 - complexd_i * c));} +#if (__cplusplus >= 201103L) // стандарт C++ 11 или выше +# define acosc_qpie acos +# define asinc_qpie asin +# define atanc_qpie atan +#else +inline complexd atanc_qpie(const complexd & c) {return complexd(0., 0.5) * log((complexd_1 - complexd_i * c) / (complexd_1 + complexd_i * c));} inline complexd asinc_qpie(const complexd & c) {return -complexd_i * log(complexd_i * c + sqrt(complexd_1 - c * c));} inline complexd acosc_qpie(const complexd & c) {return -complexd_i * log(c + complexd_i * sqrt(complexd_1 - c * c));} +#endif namespace QPIEvaluatorTypes { static const int operationCount = 14;