Skip to content

Commit 963bd98

Browse files
committed
Wow, managed two bugs in a 25-character line
1 parent 2fb5069 commit 963bd98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ int sample_from_pdf(const float *pdf, int N, float exp_boost, float pdf_floor)
275275
r = tmp[N-1] * ((float)rand()/RAND_MAX);
276276
for (i=0;i<N-1;i++)
277277
{
278-
if (r > tmp[i]) return r;
278+
if (r < tmp[i]) return i;
279279
}
280280
return N-1;
281281
}

0 commit comments

Comments
 (0)