Skip to content

Optimize pcg32_boundedrand_r()#9

Open
MrSmile wants to merge 1 commit intoimneme:masterfrom
MrSmile:new-bounded
Open

Optimize pcg32_boundedrand_r()#9
MrSmile wants to merge 1 commit intoimneme:masterfrom
MrSmile:new-bounded

Conversation

@MrSmile
Copy link

@MrSmile MrSmile commented Mar 2, 2017

That variant requires only one division instead of two in the usual case of small bound. Even in the worst case of bound = 2^31+1 average number of divisions will be 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant