JuliaRandom / RandomNumbers.jl

Random Number Generators for the Julia Language.
https://juliarandom.github.io/RandomNumbers.jl/stable
Other
97 stars 23 forks source link

Ambiguity error with complex numbers #84

Closed maleadt closed 3 years ago

maleadt commented 3 years ago
rand!(rng, zeros(ComplexF32, 1))
ERROR: MethodError: rand(::Philox2x{UInt64, 10}, ::Random.SamplerType{ComplexF32}) is ambiguous. Candidates:
  rand(r::AbstractRNG, ::Random.SamplerType{Complex{T}}) where T<:Real in Random at /home/tim/.cache/jl/installs/bin/linux/x64/1.7/julia-1.7-latest-linux-x86_64/share/julia/stdlib/v1.7/Random/src/generation.jl:159
  rand(rng::RandomNumbers.AbstractRNG, ::Random.SamplerType{T}) where T in RandomNumbers at /home/tim/Julia/depot/packages/RandomNumbers/7RJNC/src/common.jl:17
Possible fix, define
  rand(::RandomNumbers.AbstractRNG, ::Random.SamplerType{Complex{T}}) where T<:Real
sunoru commented 3 years ago

Thanks a lot. I'll fix it later.