Skip to content

Commit

Permalink
@daviddelaat fix, add missing AbstractRNG parameter when drawing from…
Browse files Browse the repository at this point in the history
… a Range for rand(::Char)
  • Loading branch information
jakebolewski committed May 7, 2015
1 parent 2bd0de3 commit 05f5afe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ rand{T<:Real}(r::AbstractRNG, ::Type{Complex{T}}) = complex(rand(r, T), rand(r,
# random Char values
# returns a random valid Unicode scalar value (i.e. 0 - 0xd7ff, 0xe000 - # 0x10ffff)
function rand(r::AbstractRNG, ::Type{Char})
c = rand(0x00000000:0x0010f7ff)
c = rand(r, 0x00000000:0x0010f7ff)
(c < 0xd800) ? Char(c) : Char(c+0x800)
end

Expand Down

0 comments on commit 05f5afe

Please sign in to comment.