 //Fischer shuffle algorithm to replace our bins randomly
 //sample without replacement once for indexes to replace
 	for(int i=0;i<num_bins-1;i++){
-		int Rand=(((num_bins-i)*rand())/RAND_MAX );
+		int Rand=(((num_bins-i)*rand())/(float) RAND_MAX );
 		int temp=exclusive_random[num_bins-i-1];
 		exclusive_random[num_bins-i-1]=exclusive_random[Rand];
 		exclusive_random[Rand]=temp;


}

// ********************* main() ****************** //

int main( int argc, char** argv)
{

#include <omp.h>

#define TBS 256 //this is the threads per block for the jackknife reduction kernel
#define ELS 10240000 //number of elements
#define NTHREADS 13 //only valid for Open MP Jackknife, dependent on the system number of cores available
#define EPB 128 //elements per bin in bootstrap
#define ELPB 128 //threads per block (elements per bootstrap) in bootstrap
#define BOOTS 16384 //number of bootstraps
// see main() below for what happens when each of the following is 0/1
#define CPU_JACK 0
#define OMP_JACK 0
#define GPU_JACK 0
#define CPU_BOOT 1
#define LOOP_BOOT 0 //loop_boot=1 and gpu_boot=1 causes us to loop over different bin sizes
#define GPU_BOOT 1
#define BSTRAP 1 //this is which bootstrap method we run, 1 is the quickest but has some bias, 3 is slowest and has no bias, 2 is between 1 and 3.



