From 35c85effecb5a615a361c1b7d92d08447bc83423 Mon Sep 17 00:00:00 2001 From: Hossein Date: Thu, 11 Nov 2021 00:00:38 +0100 Subject: Use M_PI instead of defined value; use rad2deg() * Replace defined values of PI with M_PI defined in * Use M_PI_2 instead of PI / 2.0 * Instances could be found with: git grep 3.14 *.cxx *.hxx|grep define * One instance is ignored: sc/source/core/opencl/opinlinefun_statistical.cxx * Replace *(180 / PI) with basegfx::rad2deg() * Replace 2*PI/360 with basegfx::deg2rad() * Use atan2 instead of atan where it was more appropriate + atan2() handles all 4 quadrants + Extra conditions for different quadrants are removed Change-Id: I083ee2e1427cd36ba0b8c38e4fe5f782d6486075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124229 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- scaddins/source/analysis/analysis.cxx | 2 +- scaddins/source/analysis/analysishelper.hxx | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'scaddins/source') diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index dca1c370d994..9ad63bc15efa 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -561,7 +561,7 @@ double SAL_CALL AnalysisAddIn::getMround( double fNum, double fMult ) double SAL_CALL AnalysisAddIn::getSqrtpi( double fNum ) { - double fRet = sqrt( fNum * PI ); + double fRet = sqrt( fNum * M_PI ); RETURN_FINITE( fRet ); } diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index 7e0610493929..093d939301eb 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -35,10 +35,6 @@ namespace sca::analysis { class ScaAnyConverter; - -#define PI 3.1415926535897932 - - inline bool IsLeapYear( sal_uInt16 nYear ); #ifdef DISABLE_DYNLOADING -- cgit