https://issues.apache.org/ooo/show_bug.cgi?id=121421
orcmid <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from orcmid <[email protected]> --- It appears, based on the problems that Excel had getting a correct implementation of the Wichman-Hill algorithm, that one must be very careful about attempting a literal transcription of the method. First, salting must ensure that the initial IX, IY, and IZ values are positive nonzero values less than the corresponding modulus values (30269, 30307, and 30323). In addition, the possibility of values <= 0 as the result of integer multiplication overflows must be protected against. Note that an intermediate product before any MOD is taken can be as large as 5,212,632 and the division in the implementation of MOD must work with dividends that large as well. I'm also marginally suspicious of all of those floating-point divisions, since the moduli are all relatively prime to 2 (and 5). The arithmetic in the RANDOM line should all be in DOUBLE (if not greater) and it is not clear how many bits of the AMOD result should be considered reliable, since recurrence patterns will happen. Also, before claiming DIEHARD, it is really important to actually run it on the implemented code. I can't imagine that the defects noted in the Excel implementation would not have been caught. I just made an Excel 2010 Spreadsheet with 500 =RAND() cells. I don't see any of the problems that were noticed in the testing that was reported in 2004. It works fine in Excel 2013 Release Preview too. Finally, Excel 2003 SP3 also does just fine. Saving as an .XLS from 2003, it opened fine in AOO 3.4.1 and LibreOffice 3.6.2 although I did not do any testing -- just eye-balling, so I don't know about duplicates or other repetition problems. I am seeing =RAND() as decimal fractions to 9 or 10 decimal digits, depending on the application. I did not convert them to some range of integers and I didn't think to put them in a CSV and sort them. Some other time. -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.
