Skip to content

Commit ebca0e5

Browse files
Fix issue mattiasgustavsson#46 xorshift rng returning wrong value for range
1 parent 38a5fbb commit ebca0e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rnd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ int rnd_xorshift_range( rnd_xorshift_t* xorshift, int min, int max )
508508
{
509509
int const range = ( max - min ) + 1;
510510
if( range <= 0 ) return min;
511-
int const value = (int) ( rnd_xorshift_next( xorshift ) * range );
511+
int const value = (int) ( rnd_xorshift_nextf( xorshift ) * range );
512512
return min + value;
513513
}
514514

0 commit comments

Comments
 (0)