Skip to content

Commit

Permalink
Remove defintion of iszero
Browse files Browse the repository at this point in the history
Was added in #305.
  • Loading branch information
martinholters committed Aug 31, 2018
1 parent 550d2ce commit e081312
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `>:`, a supertype operator for symmetry with `issubtype` (`A >: B` is equivalent to `B <: A`), can be used in 0.5 and earlier ([#20407]).

* `iszero(x)` efficiently checks whether `x == zero(x)` (including arrays) can be used in 0.5 and earlier ([#19950]).

* `.&` and `.|` are short syntax for `broadcast(&, xs...)` and `broadcast(|, xs...)` (respectively) in Julia 0.6 (only supported on Julia 0.5 and above) ([#17623])

* `Compat.isapprox` with `nans` keyword argument ([#20022])
Expand Down Expand Up @@ -492,7 +490,6 @@ includes this fix. Find the minimum version from there.
[#19449]: https://github.com/JuliaLang/julia/issues/19449
[#19635]: https://github.com/JuliaLang/julia/issues/19635
[#19784]: https://github.com/JuliaLang/julia/issues/19784
[#19950]: https://github.com/JuliaLang/julia/issues/19950
[#20005]: https://github.com/JuliaLang/julia/issues/20005
[#20022]: https://github.com/JuliaLang/julia/issues/20022
[#20164]: https://github.com/JuliaLang/julia/issues/20164
Expand Down
9 changes: 0 additions & 9 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,6 @@ else
end
end

# julia #19950
@static if !isdefined(Base, :iszero)
# 0.6
iszero(x) = x == zero(x)
iszero(x::Number) = x == 0
iszero(x::AbstractArray) = all(iszero, x)
export iszero
end

# julia #20407
@static if !isdefined(Base, :(>:))
# 0.6
Expand Down
16 changes: 0 additions & 16 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ let s = "Koala test: 🐨"
end
end

# julia#19950, tests from Base (#20028)
for T in (Float16, Float32, Float64, BigFloat, Int8, Int16, Int32, Int64, Int128,
BigInt, UInt8, UInt16, UInt32, UInt64, UInt128)
@test iszero(T(0))
@test iszero(Complex{T}(0))
if T<:Integer
@test iszero(Rational{T}(0))
end
if T<:AbstractFloat
@test iszero(T(-0.0))
@test iszero(Complex{T}(-0.0))
end
end
@test !iszero([0, 1, 2, 3])
@test iszero([0, 0, 0, 0])

let
x = view(1:10, 2:4)
D = Diagonal(x)
Expand Down

0 comments on commit e081312

Please sign in to comment.