From eb98c2ee9400305cb2001fc9d64501c75a5e0432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Thu, 5 Mar 2020 10:07:48 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/libs@737 a8b55f48-bf90-11e4-a774-851b48703e85 --- qad/utils/qpievaluator.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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;