https://issues.apache.org/ooo/show_bug.cgi?id=121421

            Bug ID: 121421
        Issue Type: DEFECT
           Summary: rand() behaves poorly on some platforms
    Classification: Application
           Product: spreadsheet
           Version: AOO350-dev
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: normal
          Priority: P3
         Component: code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Calc uses libc's rand(3) as a random number generator in Calc.

The code is in:
main/sc/source/core/tool/interpr1.cxx   ScInterpreter::ScRandom()

In general rand() is not a very good random number generator, especially on
Windows: BSD 4.2 libc introduced random(3) which in general behaves better but
may not be available in all platforms.

Interestingly the methods used by MS-Excel are well documented and relatively
easy to generate:

MS-Excel up to 97 used this random generator:
http://support.microsoft.com/kb/86523

For 2003, and upper they use a better method:
http://support.microsoft.com/kb/828795

I would suggest implementing this last method.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to