[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 20 06:15:31 UTC 2019


 sc/source/core/tool/interpr3.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fd7f542c1342bdcab35c5186b629d57467bf832c
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Tue Feb 19 18:37:37 2019 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Wed Feb 20 07:15:05 2019 +0100

    tdf#74664 : Compute the phase correctly using atan2
    
    atan2() should be used to compute the phase angle as
    atan() does not know which quadrant the input point is in.
    
    Change-Id: I9d659ae32768d3787af9d0de62c9b28c1a0f5688
    Reviewed-on: https://gerrit.libreoffice.org/68016
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.francis at collabora.com>

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index e568e4f96367..243332668344 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -4908,7 +4908,7 @@ void ScFFT2::convertToPolar()
     {
         fR = getReal(nIdx);
         fI = getImag(nIdx);
-        fPhase = atan(fI/fR);
+        fPhase = atan2(fI, fR);
         fMag = sqrt(fR*fR + fI*fI);
 
         setReal(fMag, nIdx);


More information about the Libreoffice-commits mailing list