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

Winfried Donkers winfrieddonkers at libreoffice.org
Tue Feb 21 21:18:27 UTC 2017


 sc/source/core/tool/interpr3.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit ceb1b8f3baa425f0d1ec96ceb2e49e3a04ba4a0a
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Sat Feb 11 15:05:22 2017 +0100

    tdf#105937 fix incorrect constraint for Calc function T.DIST.RT.
    
    As code is shared for various t-distribution functions, the applied
    constraints did not all apply for T.DIST.RT.
    
    Change-Id: Ia68330e6fad7990e964fa5fd86fc062c156d1a4e
    Reviewed-on: https://gerrit.libreoffice.org/34149
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index b780e78..95010d2 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1649,13 +1649,17 @@ void ScInterpreter::ScTDist_T( int nTails )
     if ( !MustHaveParamCount( GetByte(), 2 ) )
         return;
     double fDF = ::rtl::math::approxFloor( GetDouble() );
-    double T   = GetDouble();
-    if ( fDF < 1.0 || T < 0.0 )
+    double fT  = GetDouble();
+    if ( fDF < 1.0 || ( nTails == 2 && fT < 0.0 ) )
     {
         PushIllegalArgument();
         return;
     }
-    PushDouble( GetTDist( T, fDF, nTails ) );
+    double fRes = GetTDist( fT, fDF, nTails );
+    if ( nTails == 1 && fT < 0.0 )
+        PushDouble( 1.0 - fRes ); // tdf#105937, right tail, negative X
+    else
+        PushDouble( fRes );
 }
 
 void ScInterpreter::ScTDist_MS()


More information about the Libreoffice-commits mailing list