Skip to content

Commit

Permalink
make integer checks explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Nov 25, 2014
1 parent 2322a7c commit 6c63a10
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions base/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,21 +477,19 @@ function ^{T<:Complex}(z::T, p::T)

# apply some corrections to force known zeros
if pim == 0
ip = trunc(pr)
if ip == pr
if isinteger(pr)
if zi == 0
im = copysign(zero(im), im)
elseif zr == 0
if isodd(ip)
re = copysign(zero(re), re)
else
if isinteger(0.5*pr) # pr is even
im = copysign(zero(im), im)
else
re = copysign(zero(re), re)
end
end
else
dr = pr*2
ip = trunc(dr)
if ip == dr && zi == 0
if isinteger(dr) && zi == 0
if zr < 0
re = copysign(zero(re), re)
else
Expand Down

0 comments on commit 6c63a10

Please sign in to comment.