Works like this (on 0.3.0-rc3):

*julia> **methods(rand)*

*# 31 methods for generic function "rand":*

*rand(::Type{Float64}) at random.jl:88*

*rand() at random.jl:89*

*rand(::Type{Float32}) at random.jl:91*

*rand(::Type{Float16}) at random.jl:92*

*rand{T<:Real}(::Type{Complex{T<:Real}}) at random.jl:94*

*rand(r::MersenneTwister) at random.jl:97*

*rand(::Type{Uint8}) at random.jl:104*

*rand(::Type{Uint16}) at random.jl:105*

*rand(::Type{Uint32}) at random.jl:106*

*rand(::Type{Uint64}) at random.jl:107*

*rand(::Type{Uint128}) at random.jl:108*

*rand(::Type{Int8}) at random.jl:110*

*rand(::Type{Int16}) at random.jl:111*

*rand(::Type{Int32}) at random.jl:112*

*rand(::Type{Int64}) at random.jl:113*

*rand(::Type{Int128}) at random.jl:114*

*rand(::Type{Float64},dims::(Int64...,)) at random.jl:118*

*rand(::Type{Float64},dims::Int64...) at random.jl:119*

*rand(dims::(Int64...,)) at random.jl:121*

*rand(dims::Int64...) at random.jl:122*

*rand(r::AbstractRNG,dims::(Int64...,)) at random.jl:124*

*rand(r::AbstractRNG,dims::Int64...) at random.jl:125*

*rand{T<:Number}(::Type{T<:Number}) at random.jl:142*

*rand(T::Type{T<:Top},dims::(Int64...,)) at random.jl:141*

*rand{T<:Number}(::Type{T<:Number},dims::Int64...) at random.jl:143*

*rand{T<:Union(Int64,Uint64)}(g::RandIntGen{T<:Union(Int64,Uint64),Uint64}) 
at random.jl:185*

*rand{T<:Integer,U<:Unsigned}(g::RandIntGen{T<:Integer,U<:Unsigned}) at 
random.jl:201*

*rand{T<:Union(Bool,Unsigned,Char,Signed)}(r::UnitRange{T<:Union(Bool,Unsigned,Char,Signed)})
 
at random.jl:208*

*rand{T}(r::Range{T}) at random.jl:209*

*rand{T}(r::Range{T},dims::(Int64...,)) at random.jl:236*

*rand(r::Range{T},dims::Int64...) at random.jl:237*


*julia> **rand(Int32)*

*-1091619314*


*julia> **rand(Int32, 10)*

*10-element Array{Int32,1}:*

*  -232135574*

* -1289647599*

* -1136027271*

*   575399837*

*  -761829090*

* -1955750348*

* -2129358352*

*  -554861937*

*  -934832989*

* -1179801152*




Am Montag, 11. August 2014 01:14:08 UTC+2 schrieb Jeff Waller:
>
> Seems like the intention is to cover many possibilities.  This would be 
> the typical rand but with type Int32 not Int64  for example.
>
> *julia> **rand(2)*
>
> *2-element Array{Float64,1}:*
>
> * 0.690068*
>
> * 0.137219*
>
> *julia> **rand(int32(2))*
>
> *ERROR: `rand` has no method matching rand(::Int32)*
>
> Is there a reason for this just kind of got overlooked because the usage 
> is rare?
>

Reply via email to