[PATCH] IZ #116920 RND returns one fix

Clio menenem at bk.ru
Mon Feb 14 09:02:09 PST 2011


---
 basic/source/runtime/methods.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index ce96f66..039c5d6 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3446,7 +3446,7 @@ RTLFUNC(Rnd)
     else
     {
         double nRand = (double)rand();
-        nRand = ( nRand / (double)RAND_MAX );
+        nRand = ( nRand / ((double)RAND_MAX + 1.0));
         rPar.Get(0)->PutDouble( nRand );
     }
 }
-- 
1.7.0.4


--------------080601060801030103010307--


More information about the LibreOffice mailing list