Search:

Type: Posts; User: xyrph

Search: Search took 0.03 seconds.

  1. Replies
    46
    Views
    26,126

    Re: VB6 Dual-Pivot-QuickSort

    Olaf,

    I noticed this line in your fantastic DualPivotQuicksort:


    If (M2 - M1) > (UB - LB - 21) Then 'handle equal elements

    Can you please shine some light on the value of 21 here? What...
  2. Replies
    1
    Views
    3,350

    VBA7 64-bit Array of Variants Overlay Problem

    I have used Olaf's fantastic code successfully for a long time now... but in Excel VBA, 32bit.

    I now need to use it in VBA7, 64bit and it seems no matter how I modify it the code either won't...
  3. Replies
    9
    Views
    1,666

    Re: Marsaglia's MWC Pseudo Random Number Generator

    Thanks, George.

    But are you sure about this:


    XORShift = ShiftRight((ShiftLeft(y, 1) + 1), 16) * ShiftRight(v, 16)

    ...because original C procedure had two references to the variable 'y'.
    ...
  4. Replies
    9
    Views
    1,666

    Re: Marsaglia's MWC Pseudo Random Number Generator

    Thanks. I made that change. It seems to be working, but I am surprised by the results. Here are the first 10:

    -348528372
    6337452
    -246228039
    -421112020
    -4215600
    -327345624
    578138499 ...
  5. Replies
    9
    Views
    1,666

    Re: Marsaglia's MWC Pseudo Random Number Generator

    Arrgghh. I'm not able to edit my post, but I wanted to include that I do declare the variables at the top of the module like so:


    Private x&, y&, z&, w&, v&
  6. Replies
    9
    Views
    1,666

    Re: Marsaglia's MWC Pseudo Random Number Generator

    OK. So I reworked it like so (omitting the bit shifting routines for brevity):


    Sub MWC()

    x = 123456789: y = 362436069: z = 521288629: w = 88675123: v = 886756453

    MsgBox XORShift
    ...
  7. Replies
    9
    Views
    1,666

    Marsaglia's MWC Pseudo Random Number Generator

    I was experimenting to see if I could make this work in VB6/VBA. I am not a C programmer, but I crossing my fingers I could navigate the XORing and bitshifting required here enough to give it a go. I...
Results 1 to 7 of 7



Click Here to Expand Forum to Full Width