The tests of a package of mine are failing with the nightly build of Julia, and I have found out that the reason is that the behavior of the random number generator changed when it is called with a range.
I have two questions:
-
Should I care about nightly builds failing at all? Is it likely that the behavior will return back to what it was previously so that I should wait for the final release of 1.6 to even bother with that?
-
Is there any option to guarantee among different releases that the exact same random number generator is used (I understand that having the same behavior in general is not guaranteed, but there could be an option to be used just for testing).
Thank you.
The output of rand
in different versions is shown bellow:
Nightly:
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.0-DEV.1451 (2020-11-09)
_/ |\__'_|_|_|\__'_| | Commit d562a97f2b (0 days old master)
|__/ |
julia> import Random
julia> Random.seed!(1);
julia> rand()
0.23603334566204692
julia> rand(1:10)
6
1.5.2:
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.5.2 (2020-09-23)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> import Random
julia> Random.seed!(1);
julia> rand()
0.23603334566204692
julia> rand(1:10)
10
29 posts - 5 participants