Skip to content

Conversation

NNBnh
Copy link

@NNBnh NNBnh commented Jun 20, 2025

This will resolve #13. The function's algorithm and doc strings (include example) were ported fatefully from the gleam_stdlib.

However, there is a need to create some internal functions std_int and std_float that act more like theirs counterpart in the gleam_stdlib, because:

  • From int.random doc: "The lower number is inclusive, the upper number is exclusive."
  • From float.random doc: "Generates a random float between the given zero (inclusive) and one (exclusive)."

The prng lib currently doesn't support generates number with one end or both end exclusive. So I have to make some ad-hoc functions that do it.

I also try to make the test for these two functions, but I don't feed like I can write it the right way...

@NNBnh
Copy link
Author

NNBnh commented Jul 16, 2025

Could you merge or take a look at this PR pretty please?

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.

What is the best way to with prng?
1 participant