Skip to content

Commit 8eba7c4

Browse files
authored
Random: always use SamplerRangeFast for MersenneTwister (#27560)
1 parent 0978251 commit 8eba7c4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stdlib/Random/src/RNGs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ end
539539

540540
#### from a range
541541

542-
for T in BitInteger_types # eval because of ambiguity otherwise
543-
@eval Sampler(rng::MersenneTwister, r::UnitRange{$T}, ::Val{1}) =
542+
for T in BitInteger_types, R=(1, Inf) # eval because of ambiguity otherwise
543+
@eval Sampler(rng::MersenneTwister, r::UnitRange{$T}, ::Val{$R}) =
544544
SamplerRangeFast(r)
545545
end
546546

stdlib/Random/src/misc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ number generator, see [Random Numbers](@ref).
5353
# Examples
5454
```jldoctest
5555
julia> srand(0); randstring()
56-
"Qgt7sUOP"
56+
"0IPrGg0J"
5757
5858
julia> randstring(MersenneTwister(0), 'a':'z', 6)
59-
"oevnou"
59+
"aszvqk"
6060
6161
julia> randstring("ACGT")
6262
"TATCGGTC"

0 commit comments

Comments
 (0)