Skip to content

Commit 7513015

Browse files
authored
Merge pull request olcf#30 from mjbach/master
bugfix for skewed distribution
2 parents 6124021 + 220b300 commit 7513015

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

file_tree.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ off_t gen_size(lcio_dist_t* dist){
4242

4343
while(1) {
4444
x = drand48();
45-
i = (int) floor((dist->len - 1) * x) + 1;
46-
y = (dist->len-1) * x + 1 - i;
45+
i = (int) floor((dist->len) * x);
46+
y = (dist->len) * x - i;
4747
if(y < d[i]) break;
4848
}
4949

0 commit comments

Comments
 (0)