Kaydet (Commit) ce239f39 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

RANDBETWEEN is supposed to return an integer

Change-Id: I82e7963b55cf2ab28c193f40fe8f30e097364653
üst 4066cc6b
...@@ -702,7 +702,7 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw( ...@@ -702,7 +702,7 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw(
if( fMin > fMax ) if( fMin > fMax )
throw lang::IllegalArgumentException(); 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 ); RETURN_FINITE( fRet );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment