You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils.jl
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -183,6 +183,7 @@ Base.zero(q::Q) where {Q<:UnionAbstractQuantity} = new_quantity(Q, zero(ustrip(q
183
183
Base.zero(::AbstractDimensions) =error("There is no such thing as an additive identity for a `AbstractDimensions` object, as + is only defined for `UnionAbstractQuantity`.")
184
184
Base.zero(::Type{<:UnionAbstractQuantity}) =error("Cannot create an additive identity for a `UnionAbstractQuantity` type, as the dimensions are unknown. Please use `zero(::UnionAbstractQuantity)` instead.")
185
185
Base.zero(::Type{<:AbstractDimensions}) =error("There is no such thing as an additive identity for a `AbstractDimensions` type, as + is only defined for `UnionAbstractQuantity`.")
186
+
Base.zero(x::Array{Q}) where {Q<:UnionAbstractQuantity} =zero.(x)
186
187
187
188
# Dimensionful 1 (oneunit)
188
189
Base.oneunit(q::Q) where {Q<:UnionAbstractQuantity} =new_quantity(Q, oneunit(ustrip(q)), dimension(q))
0 commit comments