Skip to content

Commit e081312

Browse files
committed
Remove defintion of iszero
Was added in #305.
1 parent 550d2ce commit e081312

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ Currently, the `@compat` macro supports the following syntaxes:
136136

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

139-
* `iszero(x)` efficiently checks whether `x == zero(x)` (including arrays) can be used in 0.5 and earlier ([#19950]).
140-
141139
* `.&` and `.|` are short syntax for `broadcast(&, xs...)` and `broadcast(|, xs...)` (respectively) in Julia 0.6 (only supported on Julia 0.5 and above) ([#17623])
142140

143141
* `Compat.isapprox` with `nans` keyword argument ([#20022])
@@ -492,7 +490,6 @@ includes this fix. Find the minimum version from there.
492490
[#19449]: https://github.com/JuliaLang/julia/issues/19449
493491
[#19635]: https://github.com/JuliaLang/julia/issues/19635
494492
[#19784]: https://github.com/JuliaLang/julia/issues/19784
495-
[#19950]: https://github.com/JuliaLang/julia/issues/19950
496493
[#20005]: https://github.com/JuliaLang/julia/issues/20005
497494
[#20022]: https://github.com/JuliaLang/julia/issues/20022
498495
[#20164]: https://github.com/JuliaLang/julia/issues/20164

src/Compat.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ else
142142
end
143143
end
144144

145-
# julia #19950
146-
@static if !isdefined(Base, :iszero)
147-
# 0.6
148-
iszero(x) = x == zero(x)
149-
iszero(x::Number) = x == 0
150-
iszero(x::AbstractArray) = all(iszero, x)
151-
export iszero
152-
end
153-
154145
# julia #20407
155146
@static if !isdefined(Base, :(>:))
156147
# 0.6

test/runtests.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,6 @@ let s = "Koala test: 🐨"
6262
end
6363
end
6464

65-
# julia#19950, tests from Base (#20028)
66-
for T in (Float16, Float32, Float64, BigFloat, Int8, Int16, Int32, Int64, Int128,
67-
BigInt, UInt8, UInt16, UInt32, UInt64, UInt128)
68-
@test iszero(T(0))
69-
@test iszero(Complex{T}(0))
70-
if T<:Integer
71-
@test iszero(Rational{T}(0))
72-
end
73-
if T<:AbstractFloat
74-
@test iszero(T(-0.0))
75-
@test iszero(Complex{T}(-0.0))
76-
end
77-
end
78-
@test !iszero([0, 1, 2, 3])
79-
@test iszero([0, 0, 0, 0])
80-
8165
let
8266
x = view(1:10, 2:4)
8367
D = Diagonal(x)

0 commit comments

Comments
 (0)