Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid trunc error in smarsa_BirthSpacings in bigcrushJulia #32

Merged

Conversation

GregPlowman
Copy link
Contributor

Issue #28

Fix for bigcrushJulia battery test.
Use alternative parameters for smarsa_BirthdaySpacings to avoid error when passing 2^31 to Clong argument on Windows, where Clong is defined as Int32.

Copied alternative parameters from TestU01 c code (testu01/bbattery.c)

  {
      sres_Poisson *res;
      res = sres_CreatePoisson ();
#ifdef USE_LONGLONG
      ++j2;
      for (i = 0; i < Rep[j2]; ++i) {
         long d;
#if LONG_MAX <= 2147483647L
         d = 1073741824L;
         smarsa_BirthdaySpacings (gen, res, 250, 4 * MILLION, 0, d, 2, 1);
#else
         d = 2147483648L;
         smarsa_BirthdaySpacings (gen, res, 100, 10 * MILLION, 0, d, 2, 1);
#endif
         bbattery_pVal[++j] = res->pVal2;
         TestNumber[j] = j2;
         strcpy (bbattery_TestNames[j], "BirthdaySpacings, t = 2");
      }

Fix for bigcrushJulia battery test on Windows.
On Windows Clong is defined as Int32
Use alternative parameters for smarsa_BirthdaySpacings to avoid error when converting 2^31 to Int32.
Test conditional call to smarsa_BirthdaySpacings which avoids error on Windows passing 2^31 to Clong which is defined as Int32
@andreasnoack andreasnoack merged commit cd8c174 into JuliaRandom:master Jan 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants