@@ -343,7 +343,7 @@ fill(v, dims::Integer...) = fill!(Array{typeof(v)}(uninitialized, dims...), v)
343343 zeros([T=Float64,] dims...)
344344
345345Create an `Array`, with element type `T`, of all zeros with size specified by `dims`.
346- See also [`similar`](@ref).
346+ See also [`fill`](@ref), [` similar`](@ref).
347347
348348# Examples
349349```jldoctest
@@ -359,34 +359,10 @@ julia> zeros(Int8, 2, 3)
359359"""
360360function zeros end
361361
362- """
363- ones([T=Float64,] dims...)
364-
365- Create an `Array`, with element type `T`, of all ones with size specified by `dims`.
366- See also [`zeros`](@ref), [`similar`](@ref).
367-
368- # Examples
369- ```jldoctest
370- julia> ones(1,2)
371- 1×2 Array{Float64,2}:
372- 1.0 1.0
373-
374- julia> ones(ComplexF64, 2, 3)
375- 2×3 Array{Complex{Float64},2}:
376- 1.0+0.0im 1.0+0.0im 1.0+0.0im
377- 1.0+0.0im 1.0+0.0im 1.0+0.0im
378- ```
379- """
380- function ones end
381-
382- for (fname, felt) in ((:zeros , :zero ), (:ones , :one ))
383- @eval begin
384- $ fname (:: Type{T} , dims:: NTuple{N, Any} ) where {T, N} = fill! (Array {T,N} (uninitialized, convert (Dims, dims):: Dims ), $ felt (T))
385- $ fname (dims:: Tuple ) = ($ fname)(Float64, dims)
386- $ fname (:: Type{T} , dims... ) where {T} = $ fname (T, dims)
387- $ fname (dims... ) = $ fname (dims)
388- end
389- end
362+ zeros (:: Type{T} , dims:: NTuple{N, Any} ) where {T, N} = fill! (Array {T,N} (uninitialized, convert (Dims, dims)), zero (T))
363+ zeros (dims:: Tuple ) = (zeros)(Float64, dims)
364+ zeros (:: Type{T} , dims... ) where {T} = zeros (T, dims)
365+ zeros (dims... ) = zeros (dims)
390366
391367function _one (unit:: T , x:: AbstractMatrix ) where T
392368 m,n = size (x)
0 commit comments