To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=116920 Issue #|116920 Summary|Sometimes RND returns 1 (one) Component|scripting Version|OOO330m20 Platform|Unknown URL| OS/Version|All Status|NEW Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P4 Subcomponent|code Assigned to|kr Reported by|bormant
------- Additional comments from borm...@openoffice.org Fri Feb 11 07:29:22 +0000 2011 ------- Basic Rnd function SHOULD return pseudorandom value greater or equal than 0 and LESS than 1. So, 0 <= Rnd < 1 or [0; 1) interval. In OpenOffice.org it returns value greater or equal than 0 and LESS OR EQUAL than 1. Code: Sub TestRnd tries& = 10000000 s% = 0 For i& = 1 To tries If Rnd = 1 Then s = s + 1 Next MsgBox s / tries End Sub Expected result: 0 Result: 3,28E-05 (or near because of random values). This randomly breaks down an algorithms believing the Rnd value strictly LESS than 1 with out of bound errors. Same behaviour in OOo 3.3.0, 3.1.1, 2.4.3. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@script.openoffice.org For additional commands, e-mail: issues-h...@script.openoffice.org --------------------------------------------------------------------- To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org