From d8f0cc28241aa6b23924080621a511f0fcbe6d09 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 26 Apr 2014 10:40:44 +0300 Subject: [PATCH] Use standard math constants. --HG-- branch : feature --- src/libs/qmuparser/qmuparser.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 3f63b4b86..2517cd8fb 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -25,16 +25,9 @@ #include //--- Standard includes ------------------------------------------------------------------------ -#include #include #include -/** \brief Pi (what else?). */ -#define QmuParser_CONST_PI 3.141592653589793238462643 - -/** \brief The eulerian number. */ -#define QmuParser_CONST_E 2.718281828459045235360287 - using namespace std; /** \file @@ -80,7 +73,7 @@ namespace qmu //--------------------------------------------------------------------------- // misc - qreal QmuParser::Abs(qreal v) { return (v>=0) ? v : -v; } + qreal QmuParser::Abs(qreal v) { return qAbs(v); } qreal QmuParser::Rint(qreal v) { return qFloor(v + (qreal)0.5); } qreal QmuParser::Sign(qreal v) { return (qreal)((v<0) ? -1 : (v>0) ? 1 : 0); } @@ -269,8 +262,8 @@ void QmuParser::InitFun() */ void QmuParser::InitConst() { - DefineConst("_pi", (qreal)QmuParser_CONST_PI); - DefineConst("_e", (qreal)QmuParser_CONST_E); + DefineConst("_pi", (qreal)M_PI); + DefineConst("_e", (qreal)M_E); } //---------------------------------------------------------------------------