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

Winfried Donkers winfrieddonkers at libreoffice.org
Tue Feb 21 12:43:24 UTC 2017


 sc/source/core/tool/interpr3.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 76198c537fa7595b94b2f930081bf7f6ec966dbe
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Fri Feb 17 17:16:13 2017 +0100

    tdf#106049 Apply proper constraints for Calc function T.INV.
    
    Probability p must be 0 < p < 1 for inverse cumulative left-tailed
    t-distribution function.
    
    Change-Id: I4f79eac8c9362e31de46b3ff4ebe7283ec475fac
    Reviewed-on: https://gerrit.libreoffice.org/34375
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 47625c5..b780e78 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2268,7 +2268,9 @@ void ScInterpreter::ScTInv( int nType )
     }
     if ( nType == 4 ) // left-tailed cumulative t-distribution
     {
-        if ( fP < 0.5 )
+        if ( fP == 1.0 )
+            PushIllegalArgument();
+        else if ( fP < 0.5 )
             PushDouble( -GetTInv( 1 - fP, fDF, nType ) );
         else
             PushDouble( GetTInv( fP, fDF, nType ) );


More information about the Libreoffice-commits mailing list