Skip to content

Commit

Permalink
fix gs_rand_gen_range_long
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFrenik committed Sep 8, 2023
1 parent 852eb9c commit ff836ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7472,8 +7472,7 @@ gs_rand_gen(gs_mt_rand_t* rand)
GS_API_DECL uint64_t
gs_rand_gen_range_long(gs_mt_rand_t* rand, int32_t min, int32_t max)
{
double v = (gs_map_range(0.0, 1.0, (float)min, (float)max, (float)gs_rand_gen(rand)));
return (uint64_t)round(v);
return (uint64_t)(floorf(gs_rand_gen_range(rand, (double)min, (double)max)));
}

GS_API_DECL double
Expand Down

0 comments on commit ff836ef

Please sign in to comment.