Skip to content

Instantly share code, notes, and snippets.

@compressed
Created September 12, 2012 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save compressed/3703480 to your computer and use it in GitHub Desktop.
Save compressed/3703480 to your computer and use it in GitHub Desktop.
julia> type MyType
f::Function
end
julia> MyType() = MyType(() -> randi(2000)/1000.0 - 1)
julia> s = MyType()
MyType(#<function>)
julia> [s.f() for j=1:10]
10-element Any Array:
0.687
-0.686
-0.221
-0.156
-0.111
0.774
-0.728
-0.7
0.237
-0.24
# How do I change from 'Any' array to 'Float64'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment