Skip to content

Commit

Permalink
add inv(::Missing)
Browse files Browse the repository at this point in the history
  • Loading branch information
narendrakpatel committed Mar 24, 2019
1 parent a84970d commit 8285d78
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ New language features
`findall`, `findfirst`, `argmin`/`argmax` and `findmin`/`findmax` to work with these
objects, returning the index of matching non-missing elements in the parent ([#31008]).

* `inv(::Missing)` has now been added and returns `missing` ([#31408]).

Multi-threading changes
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion base/missing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ for f in (:(!), :(~), :(+), :(-), :(zero), :(one), :(oneunit),
:(isinteger), :(isreal), :(isnan),
:(iszero), :(transpose), :(adjoint), :(float), :(conj),
:(abs), :(abs2), :(iseven), :(ispow2),
:(real), :(imag), :(sign))
:(real), :(imag), :(sign), :(inv))
@eval ($f)(::Missing) = missing
end
for f in (:(Base.zero), :(Base.one), :(Base.oneunit))
Expand Down
2 changes: 1 addition & 1 deletion test/missing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Base.one(::Type{Unit}) = 1
identity, zero, one, oneunit,
iseven, isodd, ispow2,
isfinite, isinf, isnan, iszero,
isinteger, isreal, transpose, adjoint, float]
isinteger, isreal, transpose, adjoint, float, inv]

# All elementary functions return missing when evaluating missing
for f in elementary_functions
Expand Down

0 comments on commit 8285d78

Please sign in to comment.