Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRandom.int low byte always zero for large ranges in Core 5.1.1 #917
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Oct 31, 2017
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Oct 31, 2017
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
electronjoe
Oct 31, 2017
Additional information:
Browser: Chrome 61.0.3163.100 (Official Build) (64-bit)
OS: OSX Sierra 10.12.6
electronjoe
commented
Oct 31, 2017
|
Additional information: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
electronjoe
Nov 1, 2017
Wanted to follow up for people who might come across this. I understand that mgold/elm-random-pcg is going to become mainline soon? I migrated to mgold/elm-random-pcg, it was completely API compatible with Core.Random - and resolved my issue.
electronjoe
commented
Nov 1, 2017
|
Wanted to follow up for people who might come across this. I understand that mgold/elm-random-pcg is going to become mainline soon? I migrated to mgold/elm-random-pcg, it was completely API compatible with Core.Random - and resolved my issue. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Nov 1, 2017
Member
Yes, that library will be in core in the next release of Elm. Using Max's library is a nice thing to do in the meantime.
|
Yes, that library will be in core in the next release of Elm. Using Max's library is a nice thing to do in the meantime. |
electronjoe commentedOct 31, 2017
I came across this when verifying the randomness of my Elm application. I was using Random.Generate - but this caused me to explore in the REPL - and demonstrated unexpected behavior.
Note in the random output examples below
1870605312 = 0x6F7F2C00
-40506368 = 0xFD95EC00
In experimentation - all outputs appear to be 24 bits of randomness with a low byte of zero? Unless I'm somehow abusing things.