Skip to content

Generating numbers from exclusive range? #30

Answered by effolkronium
zixin96 asked this question in Q&A
Discussion options

You must be logged in to vote

Well, for floating numbers you can try something like this

auto val = Random::get(0.f, 0.99999999f);

Depending on your precision requirements:
https://stackoverflow.com/a/13543600/5734836

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zixin96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants