Skip to content

Commit 674be88

Browse files
Merge pull request #247 from araujoms/iseven
add back iseven for julia 1.6
2 parents 75d3027 + 3c71891 commit 674be88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/type/predicates.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,8 @@ iseven(x::DoubleFloat{T}) where {T<:IEEEFloat} =
133133
else
134134
false
135135
end
136+
137+
if VERSION < v"1.7"
138+
iseven(x::AbstractFloat) = isinteger(x) && (abs(x) > maxintfloat(x) || iseven(Integer(x)))
139+
isodd(x::AbstractFloat) = isinteger(x) && abs(x) maxintfloat(x) && isodd(Integer(x))
140+
end

0 commit comments

Comments
 (0)