sample method

double sample()

Return sample from PRNG

Implementation

double sample() {
  int retVal;

  if (++inext >= 56) {
    inext = 1;
  }

  if (++inextp >= 56) {
    inextp = 1;
  }

  retVal = seedArray[inext]- seedArray[inextp];

  if (retVal < 0) {
    retVal += mBig;
  }

  seedArray[inext] = retVal;

  return retVal * (1.0 / mBig);
}