you must have missed Julia 0.4 which told you: _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) | Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.7 (2016-09-18 16:17 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-pc-linux-gnu
julia> int(4.0) WARNING: int(x::AbstractFloat) is deprecated, use round(Int,x) instead. in depwarn at deprecated.jl:73 in int at deprecated.jl:50 while loading no file, in expression starting on line 0 4 On Thu, 2016-10-27 at 09:36, programista...@gmail.com wrote: > in ver 0.5 how to convert to Int f.e bool or Float > > julia> int(rand(Bool,10)) > ERROR: UndefVarError: int not defined > > julia> convert(Int64,rand(Bool,10)) > ERROR: MethodError: Cannot `convert` an object of type Array{Bool,1} to an > object of type Int64 > This may have arisen from a call to the constructor Int64(...), > since type constructors fall back to convert methods. Maybe the nicest now is _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) | Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-pc-linux-gnu julia> Int.(rand(Bool, 4)) 4-element Array{Int64,1}: 0 1 0 1