From ce239f392cd22a9f5ca7146272fc020395f865f5 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 18 Nov 2014 15:42:27 +0200 Subject: RANDBETWEEN is supposed to return an integer Change-Id: I82e7963b55cf2ab28c193f40fe8f30e097364653 --- scaddins/source/analysis/analysis.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scaddins/source') diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 63a532a1f56f..c0137f372e7d 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -702,7 +702,7 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw( if( fMin > fMax ) throw lang::IllegalArgumentException(); - double fRet = comphelper::rng::uniform_real_distribution(fMin, boost::math::nextafter(fMax, DBL_MAX)); + double fRet = floor(comphelper::rng::uniform_real_distribution(fMin, boost::math::nextafter(fMax+1, -DBL_MAX))); RETURN_FINITE( fRet ); } -- cgit